diff --git a/dist/index.js b/dist/index.js index 33f52a4..5cc22d2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31,35 +31,35 @@ var require_tunnel = __commonJS({ "use strict"; var net = require("net"); var tls = require("tls"); - var http = require("http"); - var https = require("https"); + var http2 = require("http"); + var https2 = require("https"); var events = require("events"); var assert = require("assert"); - var util = require("util"); - exports2.httpOverHttp = httpOverHttp2; - exports2.httpsOverHttp = httpsOverHttp2; - exports2.httpOverHttps = httpOverHttps2; - exports2.httpsOverHttps = httpsOverHttps2; - function httpOverHttp2(options) { + var util2 = require("util"); + exports2.httpOverHttp = httpOverHttp3; + exports2.httpsOverHttp = httpsOverHttp3; + exports2.httpOverHttps = httpOverHttps3; + exports2.httpsOverHttps = httpsOverHttps3; + function httpOverHttp3(options) { var agent = new TunnelingAgent(options); - agent.request = http.request; + agent.request = http2.request; return agent; } - function httpsOverHttp2(options) { + function httpsOverHttp3(options) { var agent = new TunnelingAgent(options); - agent.request = http.request; + agent.request = http2.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } - function httpOverHttps2(options) { + function httpOverHttps3(options) { var agent = new TunnelingAgent(options); - agent.request = https.request; + agent.request = https2.request; return agent; } - function httpsOverHttps2(options) { + function httpsOverHttps3(options) { var agent = new TunnelingAgent(options); - agent.request = https.request; + agent.request = https2.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; @@ -68,7 +68,7 @@ var require_tunnel = __commonJS({ var self2 = this; self2.options = options || {}; self2.proxyOptions = self2.options.proxy || {}; - self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets; + self2.maxSockets = self2.options.maxSockets || http2.Agent.defaultMaxSockets; self2.requests = []; self2.sockets = []; self2.on("free", function onFree(socket, host, port, localAddress) { @@ -85,7 +85,7 @@ var require_tunnel = __commonJS({ self2.removeSocket(socket); }); } - util.inherits(TunnelingAgent, events.EventEmitter); + util2.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self2 = this; var options = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); @@ -955,7 +955,7 @@ var require_util = __commonJS({ var assert = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); var { IncomingMessage } = require("node:http"); - var stream = require("node:stream"); + var stream2 = require("node:stream"); var net = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); @@ -1064,14 +1064,14 @@ var require_util = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; - let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path4 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path3 && path3[0] !== "/") { - path3 = `/${path3}`; + if (path4 && path4[0] !== "/") { + path4 = `/${path4}`; } - return new URL(`${origin}${path3}`); + return new URL(`${origin}${path4}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1129,24 +1129,24 @@ var require_util = __commonJS({ return null; } function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); + return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body)); } - function destroy(stream2, err) { - if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { + function destroy(stream3, err) { + if (stream3 == null || !isStream(stream3) || isDestroyed(stream3)) { return; } - if (typeof stream2.destroy === "function") { - if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { - stream2.socket = null; + if (typeof stream3.destroy === "function") { + if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { + stream3.socket = null; } - stream2.destroy(err); + stream3.destroy(err); } else if (err) { queueMicrotask(() => { - stream2.emit("error", err); + stream3.emit("error", err); }); } - if (stream2.destroyed !== true) { - stream2[kDestroyed] = true; + if (stream3.destroyed !== true) { + stream3[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; @@ -1245,13 +1245,13 @@ var require_util = __commonJS({ } } function isDisturbed(body) { - return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); + return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { - return !!(body && stream.isErrored(body)); + return !!(body && stream2.isErrored(body)); } function isReadable(body) { - return !!(body && stream.isReadable(body)); + return !!(body && stream2.isReadable(body)); } function getSocketInfo(socket) { return { @@ -1459,10 +1459,10 @@ var require_diagnostics = __commonJS({ "node_modules/undici/lib/core/diagnostics.js"(exports2, module2) { "use strict"; var diagnosticsChannel = require("node:diagnostics_channel"); - var util = require("node:util"); - var undiciDebugLog = util.debuglog("undici"); - var fetchDebuglog = util.debuglog("fetch"); - var websocketDebuglog = util.debuglog("websocket"); + var util2 = require("node:util"); + var undiciDebugLog = util2.debuglog("undici"); + var fetchDebuglog = util2.debuglog("fetch"); + var websocketDebuglog = util2.debuglog("websocket"); var isClientSet = false; var channels = { // Client @@ -1522,39 +1522,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path4, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path3); + debuglog("sending request to %s %s/%s", method, origin, path4); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path3, origin }, + request: { method, path: path4, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path3, + path4, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path4, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path3); + debuglog("trailers received from %s %s/%s", method, origin, path4); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path3, origin }, + request: { method, path: path4, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path3, + path4, error3.message ); }); @@ -1603,9 +1603,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path4, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path3); + debuglog("sending request to %s %s/%s", method, origin, path4); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1668,7 +1668,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path3, + path: path4, method, body, headers, @@ -1683,11 +1683,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path3 !== "string") { + if (typeof path4 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { + } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path3)) { + } else if (invalidPathRegex.test(path4)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -1753,7 +1753,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path3, query) : path3; + this.path = query ? buildURL(path4, query) : path4; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -2425,7 +2425,7 @@ var require_connect = __commonJS({ "use strict"; var net = require("node:net"); var assert = require("node:assert"); - var util = require_util(); + var util2 = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var timers = require_timers(); function noop3() { @@ -2494,7 +2494,7 @@ var require_connect = __commonJS({ if (!tls) { tls = require("node:tls"); } - servername = servername || options.servername || util.getServerName(host) || null; + servername = servername || options.servername || util2.getServerName(host) || null; const sessionKey = servername || hostname; assert(sessionKey); const session = customSession || sessionCache.get(sessionKey) || null; @@ -2593,7 +2593,7 @@ var require_connect = __commonJS({ message += ` (attempted address: ${opts.hostname}:${opts.port},`; } message += ` timeout: ${opts.timeout}ms)`; - util.destroy(socket, new ConnectTimeoutError(message)); + util2.destroy(socket, new ConnectTimeoutError(message)); } module2.exports = buildConnector; } @@ -3998,11 +3998,11 @@ var require_util2 = __commonJS({ var { isUint8Array } = require("node:util/types"); var { webidl } = require_webidl(); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("node:crypto"); + crypto2 = require("node:crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -4275,7 +4275,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -4290,7 +4290,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4549,8 +4549,8 @@ var require_util2 = __commonJS({ errorSteps(e); } } - function isReadableStreamLike(stream) { - return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; + function isReadableStreamLike(stream2) { + return stream2 instanceof ReadableStream || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; } function readableStreamClose(controller) { try { @@ -5107,8 +5107,8 @@ var require_formdata_parser = __commonJS({ return false; } for (let i = 0; i < length; ++i) { - const cp = boundary.charCodeAt(i); - if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) { + const cp2 = boundary.charCodeAt(i); + if (!(cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 39 || cp2 === 45 || cp2 === 95)) { return false; } } @@ -5332,7 +5332,7 @@ var require_formdata_parser = __commonJS({ var require_body = __commonJS({ "node_modules/undici/lib/web/fetch/body.js"(exports2, module2) { "use strict"; - var util = require_util(); + var util2 = require_util(); var { ReadableStreamFrom, isBlobLike, @@ -5354,8 +5354,8 @@ var require_body = __commonJS({ var { multipartFormDataParser } = require_formdata_parser(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5366,20 +5366,20 @@ var require_body = __commonJS({ var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { - const stream = weakRef.deref(); - if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { - stream.cancel("Response object has been garbage collected").catch(noop3); + const stream2 = weakRef.deref(); + if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) { + stream2.cancel("Response object has been garbage collected").catch(noop3); } }); } function extractBody(object, keepalive = false) { - let stream = null; + let stream2 = null; if (object instanceof ReadableStream) { - stream = object; + stream2 = object; } else if (isBlobLike(object)) { - stream = object.stream(); + stream2 = object.stream(); } else { - stream = new ReadableStream({ + stream2 = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { @@ -5392,7 +5392,7 @@ var require_body = __commonJS({ type: "bytes" }); } - assert(isReadableStreamLike(stream)); + assert(isReadableStreamLike(stream2)); let action = null; let source = null; let length = null; @@ -5407,7 +5407,7 @@ var require_body = __commonJS({ source = new Uint8Array(object.slice()); } else if (ArrayBuffer.isView(object)) { source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); - } else if (util.isFormDataLike(object)) { + } else if (util2.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; @@ -5466,19 +5466,19 @@ Content-Type: ${value.type || "application/octet-stream"}\r if (keepalive) { throw new TypeError("keepalive"); } - if (util.isDisturbed(object) || object.locked) { + if (util2.isDisturbed(object) || object.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } - stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } - if (typeof source === "string" || util.isBuffer(source)) { + if (typeof source === "string" || util2.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator2; - stream = new ReadableStream({ + stream2 = new ReadableStream({ async start() { iterator2 = action(object)[Symbol.asyncIterator](); }, @@ -5490,7 +5490,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r controller.byobRequest?.respond(0); }); } else { - if (!isErrored(stream)) { + if (!isErrored(stream2)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); @@ -5505,12 +5505,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body = { stream, source, length }; + const body = { stream: stream2, source, length }; return [body, type]; } function safelyExtractBody(object, keepalive = false) { if (object instanceof ReadableStream) { - assert(!util.isDisturbed(object), "The body has already been consumed."); + assert(!util2.isDisturbed(object), "The body has already been consumed."); assert(!object.locked, "The stream is locked."); } return extractBody(object, keepalive); @@ -5617,7 +5617,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r } function bodyUnusable(object) { const body = object[kState].body; - return body != null && (body.stream.locked || util.isDisturbed(body.stream)); + return body != null && (body.stream.locked || util2.isDisturbed(body.stream)); } function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); @@ -5647,7 +5647,7 @@ var require_client_h1 = __commonJS({ "node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var util = require_util(); + var util2 = require_util(); var { channels } = require_diagnostics(); var timers = require_timers(); var { @@ -5695,11 +5695,11 @@ var require_client_h1 = __commonJS({ kResume, kHTTPContext } = require_symbols(); - var constants3 = require_constants2(); + var constants4 = require_constants2(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; - var addListener = util.addListener; - var removeAllListeners = util.removeAllListeners; + var addListener = util2.addListener; + var removeAllListeners = util2.removeAllListeners; var extractBody; async function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; @@ -5767,7 +5767,7 @@ var require_client_h1 = __commonJS({ constructor(client, socket, { exports: exports3 }) { assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants4.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -5862,22 +5862,22 @@ var require_client_h1 = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants3.ERROR.PAUSED_UPGRADE) { + if (ret === constants4.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data.slice(offset)); - } else if (ret === constants3.ERROR.PAUSED) { + } else if (ret === constants4.ERROR.PAUSED) { this.paused = true; socket.unshift(data.slice(offset)); - } else if (ret !== constants3.ERROR.OK) { + } else if (ret !== constants4.ERROR.OK) { const ptr = llhttp.llhttp_get_error_reason(this.ptr); let message = ""; if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; } - throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset)); + throw new HTTPParserError(message, constants4.ERROR[ret], data.slice(offset)); } } catch (err) { - util.destroy(socket, err); + util2.destroy(socket, err); } } destroy() { @@ -5924,13 +5924,13 @@ var require_client_h1 = __commonJS({ } const key = this.headers[len - 2]; if (key.length === 10) { - const headerName = util.bufferToLowerCasedHeaderName(key); + const headerName = util2.bufferToLowerCasedHeaderName(key); if (headerName === "keep-alive") { this.keepAlive += buf.toString(); } else if (headerName === "connection") { this.connection += buf.toString(); } - } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === "content-length") { + } else if (key.length === 14 && util2.bufferToLowerCasedHeaderName(key) === "content-length") { this.contentLength += buf.toString(); } this.trackHeader(buf.length); @@ -5938,7 +5938,7 @@ var require_client_h1 = __commonJS({ trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { - util.destroy(this.socket, new HeadersOverflowError()); + util2.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { @@ -5969,7 +5969,7 @@ var require_client_h1 = __commonJS({ try { request2.onUpgrade(statusCode, headers, socket); } catch (err) { - util.destroy(socket, err); + util2.destroy(socket, err); } client[kResume](); } @@ -5985,11 +5985,11 @@ var require_client_h1 = __commonJS({ assert(!this.upgrade); assert(this.statusCode < 200); if (statusCode === 100) { - util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket))); return -1; } if (upgrade && !request2.upgrade) { - util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket))); return -1; } assert(this.timeoutType === TIMEOUT_HEADERS); @@ -6018,7 +6018,7 @@ var require_client_h1 = __commonJS({ this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; + const keepAliveTimeout = this.keepAlive ? util2.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], @@ -6049,7 +6049,7 @@ var require_client_h1 = __commonJS({ socket[kBlocking] = false; client[kResume](); } - return pause ? constants3.ERROR.PAUSED : 0; + return pause ? constants4.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; @@ -6066,12 +6066,12 @@ var require_client_h1 = __commonJS({ } assert(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util.destroy(socket, new ResponseExceededMaxSizeError()); + util2.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; if (request2.onData(buf) === false) { - return constants3.ERROR.PAUSED; + return constants4.ERROR.PAUSED; } } onMessageComplete() { @@ -6098,21 +6098,21 @@ var require_client_h1 = __commonJS({ return; } if (request2.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util.destroy(socket, new ResponseContentLengthMismatchError()); + util2.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request2.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { assert(client[kRunning] === 0); - util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + util2.destroy(socket, new InformationalError("reset")); + return constants4.ERROR.PAUSED; } else if (!shouldKeepAlive) { - util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + util2.destroy(socket, new InformationalError("reset")); + return constants4.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { - util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + util2.destroy(socket, new InformationalError("reset")); + return constants4.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { @@ -6125,15 +6125,15 @@ var require_client_h1 = __commonJS({ if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { assert(!paused, "cannot be paused while waiting for headers"); - util.destroy(socket, new HeadersTimeoutError()); + util2.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!paused) { - util.destroy(socket, new BodyTimeoutError()); + util2.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util.destroy(socket, new InformationalError("socket idle timeout")); + util2.destroy(socket, new InformationalError("socket idle timeout")); } } async function connectH1(client, socket) { @@ -6169,7 +6169,7 @@ var require_client_h1 = __commonJS({ parser.onMessageComplete(); return; } - util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); }); addListener(socket, "close", function() { const client2 = this[kClient]; @@ -6181,7 +6181,7 @@ var require_client_h1 = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); client2[kSocket] = null; client2[kHTTPContext] = null; if (client2.destroyed) { @@ -6189,12 +6189,12 @@ var require_client_h1 = __commonJS({ const requests = client2[kQueue].splice(client2[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util.errorRequest(client2, request2, err); + util2.errorRequest(client2, request2, err); } } else if (client2[kRunning] > 0 && err.code !== "UND_ERR_INFO") { const request2 = client2[kQueue][client2[kRunningIdx]]; client2[kQueue][client2[kRunningIdx]++] = null; - util.errorRequest(client2, request2, err); + util2.errorRequest(client2, request2, err); } client2[kPendingIdx] = client2[kRunningIdx]; assert(client2[kRunning] === 0); @@ -6235,7 +6235,7 @@ var require_client_h1 = __commonJS({ if (client[kRunning] > 0 && (request2.upgrade || request2.method === "CONNECT")) { return true; } - if (client[kRunning] > 0 && util.bodyLength(request2.body) !== 0 && (util.isStream(request2.body) || util.isAsyncIterable(request2.body) || util.isFormDataLike(request2.body))) { + if (client[kRunning] > 0 && util2.bodyLength(request2.body) !== 0 && (util2.isStream(request2.body) || util2.isAsyncIterable(request2.body) || util2.isFormDataLike(request2.body))) { return true; } } @@ -6272,10 +6272,10 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path3, host, upgrade, blocking, reset } = request2; + const { method, path: path4, 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)) { + if (util2.isFormDataLike(body)) { if (!extractBody) { extractBody = require_body().extractBody; } @@ -6285,13 +6285,13 @@ var require_client_h1 = __commonJS({ } body = bodyStream.stream; contentLength = bodyStream.length; - } else if (util.isBlobLike(body) && request2.contentType == null && body.type) { + } else if (util2.isBlobLike(body) && request2.contentType == null && body.type) { headers.push("content-type", body.type); } if (body && typeof body.read === "function") { body.read(0); } - const bodyLength = util.bodyLength(body); + const bodyLength = util2.bodyLength(body); contentLength = bodyLength ?? contentLength; if (contentLength === null) { contentLength = request2.contentLength; @@ -6301,7 +6301,7 @@ var require_client_h1 = __commonJS({ } if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength !== null && request2.contentLength !== contentLength) { if (client[kStrictContentLength]) { - util.errorRequest(client, request2, new RequestContentLengthMismatchError()); + util2.errorRequest(client, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); @@ -6311,14 +6311,14 @@ var require_client_h1 = __commonJS({ if (request2.aborted || request2.completed) { return; } - util.errorRequest(client, request2, err || new RequestAbortedError()); - util.destroy(body); - util.destroy(socket, new InformationalError("aborted")); + util2.errorRequest(client, request2, err || new RequestAbortedError()); + util2.destroy(body); + util2.destroy(socket, new InformationalError("aborted")); }; try { request2.onConnect(abort); } catch (err) { - util.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } if (request2.aborted) { return false; @@ -6338,7 +6338,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path3} HTTP/1.1\r + let header = `${method} ${path4} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -6375,17 +6375,17 @@ upgrade: ${upgrade}\r } if (!body || bodyLength === 0) { writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload); - } else if (util.isBuffer(body)) { + } else if (util2.isBuffer(body)) { writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload); - } else if (util.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload); } else { writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload); } - } else if (util.isStream(body)) { + } else if (util2.isStream(body)) { writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload); - } else if (util.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload); } else { assert(false); @@ -6405,7 +6405,7 @@ upgrade: ${upgrade}\r this.pause(); } } catch (err) { - util.destroy(this, err); + util2.destroy(this, err); } }; const onDrain = function() { @@ -6442,9 +6442,9 @@ upgrade: ${upgrade}\r } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util.destroy(body, err); + util2.destroy(body, err); } else { - util.destroy(body); + util2.destroy(body); } }; body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); @@ -6473,7 +6473,7 @@ upgrade: ${upgrade}\r socket.write(`${header}\r `, "latin1"); } - } else if (util.isBuffer(body)) { + } else if (util2.isBuffer(body)) { assert(contentLength === body.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r @@ -6667,8 +6667,8 @@ var require_client_h2 = __commonJS({ "node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { pipeline } = require("node:stream"); - var util = require_util(); + var { pipeline: pipeline2 } = require("node:stream"); + var util2 = require_util(); var { RequestContentLengthMismatchError, RequestAbortedError, @@ -6742,37 +6742,37 @@ var require_client_h2 = __commonJS({ session[kOpenStreams] = 0; session[kClient] = client; session[kSocket] = socket; - util.addListener(session, "error", onHttp2SessionError); - util.addListener(session, "frameError", onHttp2FrameError); - util.addListener(session, "end", onHttp2SessionEnd); - util.addListener(session, "goaway", onHTTP2GoAway); - util.addListener(session, "close", function() { + util2.addListener(session, "error", onHttp2SessionError); + util2.addListener(session, "frameError", onHttp2FrameError); + util2.addListener(session, "end", onHttp2SessionEnd); + util2.addListener(session, "goaway", onHTTP2GoAway); + util2.addListener(session, "close", function() { const { [kClient]: client2 } = this; const { [kSocket]: socket2 } = client2; - const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util.getSocketInfo(socket2)); + const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util2.getSocketInfo(socket2)); client2[kHTTP2Session] = null; if (client2.destroyed) { assert(client2[kPending] === 0); const requests = client2[kQueue].splice(client2[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util.errorRequest(client2, request2, err); + util2.errorRequest(client2, request2, err); } } }); session.unref(); client[kHTTP2Session] = session; socket[kHTTP2Session] = session; - util.addListener(socket, "error", function(err) { + util2.addListener(socket, "error", function(err) { assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kError] = err; this[kClient][kOnError](err); }); - util.addListener(socket, "end", function() { - util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + util2.addListener(socket, "end", function() { + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); }); - util.addListener(socket, "close", function() { - const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + util2.addListener(socket, "close", function() { + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); client[kSocket] = null; if (this[kHTTP2Session] != null) { this[kHTTP2Session].destroy(err); @@ -6835,12 +6835,12 @@ var require_client_h2 = __commonJS({ } } function onHttp2SessionEnd() { - const err = new SocketError("other side closed", util.getSocketInfo(this[kSocket])); + const err = new SocketError("other side closed", util2.getSocketInfo(this[kSocket])); this.destroy(err); - util.destroy(this[kSocket], err); + util2.destroy(this[kSocket], err); } function onHTTP2GoAway(code) { - const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this)); + const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util2.getSocketInfo(this)); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; @@ -6848,11 +6848,11 @@ var require_client_h2 = __commonJS({ this[kHTTP2Session].destroy(err); this[kHTTP2Session] = null; } - util.destroy(this[kSocket], err); + util2.destroy(this[kSocket], err); if (client[kRunningIdx] < client[kQueue].length) { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - util.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); client[kPendingIdx] = client[kRunningIdx]; } assert(client[kRunning] === 0); @@ -6864,10 +6864,10 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { - util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); + util2.errorRequest(client, request2, new Error("Upgrade not supported for H2")); return false; } const headers = {}; @@ -6886,7 +6886,7 @@ var require_client_h2 = __commonJS({ headers[key] = val; } } - let stream; + let stream2; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; @@ -6895,50 +6895,50 @@ var require_client_h2 = __commonJS({ return; } err = err || new RequestAbortedError(); - util.errorRequest(client, request2, err); - if (stream != null) { - util.destroy(stream, err); + util2.errorRequest(client, request2, err); + if (stream2 != null) { + util2.destroy(stream2, err); } - util.destroy(body, err); + util2.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; client[kResume](); }; try { request2.onConnect(abort); } catch (err) { - util.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } if (request2.aborted) { return false; } if (method === "CONNECT") { session.ref(); - stream = session.request(headers, { endStream: false, signal }); - if (stream.id && !stream.pending) { - request2.onUpgrade(null, null, stream); + stream2 = session.request(headers, { endStream: false, signal }); + if (stream2.id && !stream2.pending) { + request2.onUpgrade(null, null, stream2); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { - stream.once("ready", () => { - request2.onUpgrade(null, null, stream); + stream2.once("ready", () => { + request2.onUpgrade(null, null, stream2); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } - stream.once("close", () => { + stream2.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } - headers[HTTP2_HEADER_PATH] = path3; + headers[HTTP2_HEADER_PATH] = path4; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } - let contentLength = util.bodyLength(body); - if (util.isFormDataLike(body)) { + let contentLength = util2.bodyLength(body); + if (util2.isFormDataLike(body)) { extractBody ??= require_body().extractBody; const [bodyStream, contentType] = extractBody(body); headers["content-type"] = contentType; @@ -6953,7 +6953,7 @@ var require_client_h2 = __commonJS({ } if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength != null && request2.contentLength !== contentLength) { if (client[kStrictContentLength]) { - util.errorRequest(client, request2, new RequestContentLengthMismatchError()); + util2.errorRequest(client, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); @@ -6966,36 +6966,36 @@ var require_client_h2 = __commonJS({ const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream = session.request(headers, { endStream: shouldEndStream, signal }); - stream.once("continue", writeBodyH2); + stream2 = session.request(headers, { endStream: shouldEndStream, signal }); + stream2.once("continue", writeBodyH2); } else { - stream = session.request(headers, { + stream2 = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; - stream.once("response", (headers2) => { + stream2.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(stream, err); + util2.errorRequest(client, request2, err); + util2.destroy(stream2, err); return; } - if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { - stream.pause(); + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) { + stream2.pause(); } - stream.on("data", (chunk) => { + stream2.on("data", (chunk) => { if (request2.onData(chunk) === false) { - stream.pause(); + stream2.pause(); } }); }); - stream.once("end", () => { - if (stream.state?.state == null || stream.state.state < 6) { + stream2.once("end", () => { + if (stream2.state?.state == null || stream2.state.state < 6) { request2.onComplete([]); } if (session[kOpenStreams] === 0) { @@ -7006,16 +7006,16 @@ var require_client_h2 = __commonJS({ client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); - stream.once("close", () => { + stream2.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); - stream.once("error", function(err) { + stream2.once("error", function(err) { abort(err); }); - stream.once("frameError", (type, code) => { + stream2.once("frameError", (type, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); }); return true; @@ -7023,7 +7023,7 @@ var require_client_h2 = __commonJS({ if (!body || contentLength === 0) { writeBuffer( abort, - stream, + stream2, null, client, request2, @@ -7031,10 +7031,10 @@ var require_client_h2 = __commonJS({ contentLength, expectsPayload ); - } else if (util.isBuffer(body)) { + } else if (util2.isBuffer(body)) { writeBuffer( abort, - stream, + stream2, body, client, request2, @@ -7042,11 +7042,11 @@ var require_client_h2 = __commonJS({ contentLength, expectsPayload ); - } else if (util.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable( abort, - stream, + stream2, body.stream(), client, request2, @@ -7057,7 +7057,7 @@ var require_client_h2 = __commonJS({ } else { writeBlob( abort, - stream, + stream2, body, client, request2, @@ -7066,21 +7066,21 @@ var require_client_h2 = __commonJS({ expectsPayload ); } - } else if (util.isStream(body)) { + } else if (util2.isStream(body)) { writeStream( abort, client[kSocket], expectsPayload, - stream, + stream2, body, client, request2, contentLength ); - } else if (util.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable( abort, - stream, + stream2, body, client, request2, @@ -7095,7 +7095,7 @@ var require_client_h2 = __commonJS({ } function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) { try { - if (body != null && util.isBuffer(body)) { + if (body != null && util2.isBuffer(body)) { assert(contentLength === body.byteLength, "buffer body must have content length"); h2stream.cork(); h2stream.write(body); @@ -7114,15 +7114,15 @@ var require_client_h2 = __commonJS({ } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) { assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - const pipe = pipeline( + const pipe = pipeline2( body, h2stream, (err) => { if (err) { - util.destroy(pipe, err); + util2.destroy(pipe, err); abort(err); } else { - util.removeAllListeners(pipe); + util2.removeAllListeners(pipe); request2.onRequestSent(); if (!expectsPayload) { socket[kReset] = true; @@ -7131,7 +7131,7 @@ var require_client_h2 = __commonJS({ } } ); - util.addListener(pipe, "data", onPipeData); + util2.addListener(pipe, "data", onPipeData); function onPipeData(chunk) { request2.onBodySent(chunk); } @@ -7207,7 +7207,7 @@ var require_client_h2 = __commonJS({ var require_redirect_handler = __commonJS({ "node_modules/undici/lib/handler/redirect-handler.js"(exports2, module2) { "use strict"; - var util = require_util(); + var util2 = require_util(); var { kBodyUsed } = require_symbols(); var assert = require("node:assert"); var { InvalidArgumentError } = require_errors(); @@ -7230,7 +7230,7 @@ var require_redirect_handler = __commonJS({ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } - util.validateHandler(handler2, opts.method, opts.upgrade); + util2.validateHandler(handler2, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; @@ -7239,8 +7239,8 @@ var require_redirect_handler = __commonJS({ this.handler = handler2; this.history = []; this.redirectionLimitReached = false; - if (util.isStream(this.opts.body)) { - if (util.bodyLength(this.opts.body) === 0) { + if (util2.isStream(this.opts.body)) { + if (util2.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { assert(false); }); @@ -7253,7 +7253,7 @@ var require_redirect_handler = __commonJS({ } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body)) { + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util2.isIterable(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } @@ -7268,7 +7268,7 @@ var require_redirect_handler = __commonJS({ this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + this.location = this.history.length >= this.maxRedirections || util2.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { if (this.request) { this.request.abort(new Error("max redirects")); @@ -7283,10 +7283,10 @@ var require_redirect_handler = __commonJS({ if (!this.location) { 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 path3 = search ? `${pathname}${search}` : pathname; + const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path4 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path3; + this.opts.path = path4; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -7321,20 +7321,20 @@ var require_redirect_handler = __commonJS({ return null; } for (let i = 0; i < headers.length; i += 2) { - if (headers[i].length === 8 && util.headerNameToString(headers[i]) === "location") { + if (headers[i].length === 8 && util2.headerNameToString(headers[i]) === "location") { return headers[i + 1]; } } } function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { - return util.headerNameToString(header) === "host"; + return util2.headerNameToString(header) === "host"; } - if (removeContent && util.headerNameToString(header).startsWith("content-")) { + if (removeContent && util2.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util.headerNameToString(header); + const name = util2.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; @@ -7390,8 +7390,8 @@ var require_client = __commonJS({ "use strict"; var assert = require("node:assert"); var net = require("node:net"); - var http = require("node:http"); - var util = require_util(); + var http2 = require("node:http"); + var util2 = require_util(); var { channels } = require_diagnostics(); var Request = require_request(); var DispatcherBase = require_dispatcher_base(); @@ -7574,10 +7574,10 @@ var require_client = __commonJS({ } else { this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; } - this[kUrl] = util.parseOrigin(url); + this[kUrl] = util2.parseOrigin(url); this[kConnector] = connect2; this[kPipelining] = pipelining != null ? pipelining : 1; - this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize; + this[kMaxHeadersSize] = maxHeaderSize || http2.maxHeaderSize; this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold; @@ -7637,7 +7637,7 @@ var require_client = __commonJS({ const request2 = new Request(origin, opts, handler2); this[kQueue].push(request2); if (this[kResuming]) { - } else if (util.bodyLength(request2.body) == null && util.isIterable(request2.body)) { + } else if (util2.bodyLength(request2.body) == null && util2.isIterable(request2.body)) { this[kResuming] = 1; queueMicrotask(() => resume(this)); } else { @@ -7662,7 +7662,7 @@ var require_client = __commonJS({ const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util.errorRequest(this, request2, err); + util2.errorRequest(this, request2, err); } const callback = () => { if (this[kClosedResolve]) { @@ -7688,7 +7688,7 @@ var require_client = __commonJS({ const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } assert(client[kSize] === 0); } @@ -7737,7 +7737,7 @@ var require_client = __commonJS({ }); }); if (client.destroyed) { - util.destroy(socket.on("error", noop3), new ClientDestroyedError()); + util2.destroy(socket.on("error", noop3), new ClientDestroyedError()); return; } assert(socket); @@ -7792,7 +7792,7 @@ var require_client = __commonJS({ assert(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request2 = client[kQueue][client[kPendingIdx]++]; - util.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } } else { onError(client, err); @@ -8143,7 +8143,7 @@ var require_pool = __commonJS({ var { InvalidArgumentError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = /* @__PURE__ */ Symbol("options"); @@ -8189,8 +8189,8 @@ var require_pool = __commonJS({ } this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; this[kConnections] = connections || null; - this[kUrl] = util.parseOrigin(origin); - this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; + this[kUrl] = util2.parseOrigin(origin); + this[kOptions] = { ...util2.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; this.on("connectionError", (origin2, targets, error3) => { @@ -8372,7 +8372,7 @@ var require_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var Pool = require_pool(); var Client = require_client(); - var util = require_util(); + var util2 = require_util(); var createRedirectInterceptor = require_redirect_interceptor(); var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); @@ -8384,7 +8384,7 @@ var require_agent = __commonJS({ function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } - var Agent = class extends DispatcherBase { + var Agent3 = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { super(); if (typeof factory !== "function") { @@ -8400,7 +8400,7 @@ var require_agent = __commonJS({ connect = { ...connect }; } this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util.deepClone(options), connect }; + this[kOptions] = { ...util2.deepClone(options), connect }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; @@ -8456,7 +8456,7 @@ var require_agent = __commonJS({ await Promise.all(destroyPromises); } }; - module2.exports = Agent; + module2.exports = Agent3; } }); @@ -8466,7 +8466,7 @@ var require_proxy_agent = __commonJS({ "use strict"; var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); var { URL: URL2 } = require("node:url"); - var Agent = require_agent(); + var Agent3 = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); @@ -8520,10 +8520,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path3 = "/", + path: path4 = "/", headers = {} } = opts; - opts.path = origin + path3; + opts.path = origin + path4; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -8538,7 +8538,7 @@ var require_proxy_agent = __commonJS({ return this.#client.destroy(err); } }; - var ProxyAgent2 = class extends DispatcherBase { + var ProxyAgent3 = class extends DispatcherBase { constructor(opts) { super(); if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { @@ -8581,7 +8581,7 @@ var require_proxy_agent = __commonJS({ return agentFactory(origin2, options); }; this[kClient] = clientFactory(url, { connect }); - this[kAgent] = new Agent({ + this[kAgent] = new Agent3({ ...opts, factory, connect: async (opts2, callback) => { @@ -8679,7 +8679,7 @@ var require_proxy_agent = __commonJS({ throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); } } - module2.exports = ProxyAgent2; + module2.exports = ProxyAgent3; } }); @@ -8689,8 +8689,8 @@ var require_env_http_proxy_agent = __commonJS({ "use strict"; var DispatcherBase = require_dispatcher_base(); var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols(); - var ProxyAgent2 = require_proxy_agent(); - var Agent = require_agent(); + var ProxyAgent3 = require_proxy_agent(); + var Agent3 = require_agent(); var DEFAULT_PORTS = { "http:": 80, "https:": 443 @@ -8710,16 +8710,16 @@ var require_env_http_proxy_agent = __commonJS({ }); } const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; - this[kNoProxyAgent] = new Agent(agentOpts); + this[kNoProxyAgent] = new Agent3(agentOpts); const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY }); + this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY }); } else { this[kHttpProxyAgent] = this[kNoProxyAgent]; } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; if (HTTPS_PROXY) { - this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY }); + this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY }); } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent]; } @@ -9159,7 +9159,7 @@ var require_readable = __commonJS({ var assert = require("node:assert"); var { Readable } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { ReadableStreamFrom } = require_util(); var kConsume = /* @__PURE__ */ Symbol("kConsume"); var kReading = /* @__PURE__ */ Symbol("kReading"); @@ -9261,7 +9261,7 @@ var require_readable = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed() { - return util.isDisturbed(this); + return util2.isDisturbed(this); } // https://fetch.spec.whatwg.org/#dom-body-body get body() { @@ -9312,15 +9312,15 @@ var require_readable = __commonJS({ return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; } function isUnusable(self2) { - return util.isDisturbed(self2) || isLocked(self2); + return util2.isDisturbed(self2) || isLocked(self2); } - async function consume(stream, type) { - assert(!stream[kConsume]); + async function consume(stream2, type) { + assert(!stream2[kConsume]); return new Promise((resolve, reject) => { - if (isUnusable(stream)) { - const rState = stream._readableState; + if (isUnusable(stream2)) { + const rState = stream2._readableState; if (rState.destroyed && rState.closeEmitted === false) { - stream.on("error", (err) => { + stream2.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); @@ -9330,22 +9330,22 @@ var require_readable = __commonJS({ } } else { queueMicrotask(() => { - stream[kConsume] = { + stream2[kConsume] = { type, - stream, + stream: stream2, resolve, reject, length: 0, body: [] }; - stream.on("error", function(err) { + stream2.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); - consumeStart(stream[kConsume]); + consumeStart(stream2[kConsume]); }); } }); @@ -9403,7 +9403,7 @@ var require_readable = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type, body, resolve, stream, length } = consume2; + const { type, body, resolve, stream: stream2, length } = consume2; try { if (type === "text") { resolve(chunksDecode(body, length)); @@ -9412,13 +9412,13 @@ var require_readable = __commonJS({ } else if (type === "arrayBuffer") { resolve(chunksConcat(body, length).buffer); } else if (type === "blob") { - resolve(new Blob(body, { type: stream[kContentType] })); + resolve(new Blob(body, { type: stream2[kContentType] })); } else if (type === "bytes") { resolve(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { - stream.destroy(err); + stream2.destroy(err); } } function consumePush(consume2, chunk) { @@ -9513,7 +9513,7 @@ var require_api_request = __commonJS({ var assert = require("node:assert"); var { Readable } = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("node:async_hooks"); var RequestHandler = class extends AsyncResource { @@ -9540,8 +9540,8 @@ var require_api_request = __commonJS({ } super("UNDICI_REQUEST"); } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on("error", util.nop), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); } throw err; } @@ -9560,7 +9560,7 @@ var require_api_request = __commonJS({ this.signal = signal; this.reason = null; this.removeAbortListener = null; - if (util.isStream(body)) { + if (util2.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9569,10 +9569,10 @@ var require_api_request = __commonJS({ if (this.signal.aborted) { this.reason = this.signal.reason ?? new RequestAbortedError(); } else { - this.removeAbortListener = util.addAbortListener(this.signal, () => { + this.removeAbortListener = util2.addAbortListener(this.signal, () => { this.reason = this.signal.reason ?? new RequestAbortedError(); if (this.res) { - util.destroy(this.res.on("error", util.nop), this.reason); + util2.destroy(this.res.on("error", util2.nop), this.reason); } else if (this.abort) { this.abort(this.reason); } @@ -9596,14 +9596,14 @@ var require_api_request = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } - const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; const res = new Readable({ @@ -9641,7 +9641,7 @@ var require_api_request = __commonJS({ return this.res.push(chunk); } onComplete(trailers) { - util.parseHeaders(trailers, this.trailers); + util2.parseHeaders(trailers, this.trailers); this.res.push(null); } onError(err) { @@ -9655,12 +9655,12 @@ var require_api_request = __commonJS({ if (res) { this.res = null; queueMicrotask(() => { - util.destroy(res, err); + util2.destroy(res, err); }); } if (body) { this.body = null; - util.destroy(body, err); + util2.destroy(body, err); } if (this.removeAbortListener) { res?.off("close", this.removeAbortListener); @@ -9750,7 +9750,7 @@ var require_api_stream = __commonJS({ var assert = require("node:assert"); var { finished, PassThrough } = require("node:stream"); var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("node:async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9778,8 +9778,8 @@ var require_api_stream = __commonJS({ } super("UNDICI_STREAM"); } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on("error", util.nop), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); } throw err; } @@ -9794,7 +9794,7 @@ var require_api_stream = __commonJS({ this.body = body; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; - if (util.isStream(body)) { + if (util2.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9812,7 +9812,7 @@ var require_api_stream = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); @@ -9822,7 +9822,7 @@ var require_api_stream = __commonJS({ this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; res = new PassThrough(); this.callback = null; @@ -9848,7 +9848,7 @@ var require_api_stream = __commonJS({ const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { - util.destroy(res2, err); + util2.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); @@ -9872,7 +9872,7 @@ var require_api_stream = __commonJS({ if (!res) { return; } - this.trailers = util.parseHeaders(trailers); + this.trailers = util2.parseHeaders(trailers); res.end(); } onError(err) { @@ -9881,7 +9881,7 @@ var require_api_stream = __commonJS({ this.factory = null; if (res) { this.res = null; - util.destroy(res, err); + util2.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { @@ -9890,14 +9890,14 @@ var require_api_stream = __commonJS({ } if (body) { this.body = null; - util.destroy(body, err); + util2.destroy(body, err); } } }; - function stream(opts, factory, callback) { + function stream2(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { - stream.call(this, opts, factory, (err, data) => { + stream2.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve(data); }); }); @@ -9912,7 +9912,7 @@ var require_api_stream = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module2.exports = stream; + module2.exports = stream2; } }); @@ -9930,7 +9930,7 @@ var require_api_pipeline = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { AsyncResource } = require("node:async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("node:assert"); @@ -9992,7 +9992,7 @@ var require_api_pipeline = __commonJS({ this.abort = null; this.context = null; this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util.nop); + this.req = new PipelineRequest().on("error", util2.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, @@ -10018,9 +10018,9 @@ var require_api_pipeline = __commonJS({ if (abort && err) { abort(); } - util.destroy(body, err); - util.destroy(req, err); - util.destroy(res, err); + util2.destroy(body, err); + util2.destroy(req, err); + util2.destroy(res, err); removeSignal(this); callback(err); } @@ -10046,7 +10046,7 @@ var require_api_pipeline = __commonJS({ const { opaque, handler: handler2, context } = this; if (statusCode < 200) { if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; @@ -10055,7 +10055,7 @@ var require_api_pipeline = __commonJS({ let body; try { this.handler = null; - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler2, null, { statusCode, headers, @@ -10064,7 +10064,7 @@ var require_api_pipeline = __commonJS({ context }); } catch (err) { - this.res.on("error", util.nop); + this.res.on("error", util2.nop); throw err; } if (!body || typeof body.on !== "function") { @@ -10077,14 +10077,14 @@ var require_api_pipeline = __commonJS({ } }).on("error", (err) => { const { ret } = this; - util.destroy(ret, err); + util2.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { - util.destroy(ret, new RequestAbortedError()); + util2.destroy(ret, new RequestAbortedError()); } }); this.body = body; @@ -10100,10 +10100,10 @@ var require_api_pipeline = __commonJS({ onError(err) { const { ret } = this; this.handler = null; - util.destroy(ret, err); + util2.destroy(ret, err); } }; - function pipeline(opts, handler2) { + function pipeline2(opts, handler2) { try { const pipelineHandler = new PipelineHandler(opts, handler2); this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); @@ -10112,7 +10112,7 @@ var require_api_pipeline = __commonJS({ return new PassThrough().destroy(err); } } - module2.exports = pipeline; + module2.exports = pipeline2; } }); @@ -10122,7 +10122,7 @@ var require_api_upgrade = __commonJS({ "use strict"; var { InvalidArgumentError, SocketError } = require_errors(); var { AsyncResource } = require("node:async_hooks"); - var util = require_util(); + var util2 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("node:assert"); var UpgradeHandler = class extends AsyncResource { @@ -10162,7 +10162,7 @@ var require_api_upgrade = __commonJS({ const { callback, opaque, context } = this; removeSignal(this); this.callback = null; - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, @@ -10215,7 +10215,7 @@ var require_api_connect = __commonJS({ var assert = require("node:assert"); var { AsyncResource } = require("node:async_hooks"); var { InvalidArgumentError, SocketError } = require_errors(); - var util = require_util(); + var util2 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { @@ -10254,7 +10254,7 @@ var require_api_connect = __commonJS({ this.callback = null; let headers = rawHeaders; if (headers != null) { - headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, @@ -10444,20 +10444,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path3) { - if (typeof path3 !== "string") { - return path3; + function safeUrl(path4) { + if (typeof path4 !== "string") { + return path4; } - const pathSegments = path3.split("?"); + const pathSegments = path4.split("?"); if (pathSegments.length !== 2) { - return path3; + return path4; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path3, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path3); + function matchKey(mockDispatch2, { path: path4, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path4); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10479,7 +10479,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: path3 }) => matchValue(safeUrl(path3), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10517,9 +10517,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path3, method, body, headers, query } = opts; + const { path: path4, method, body, headers, query } = opts; return { - path: path3, + path: path4, method, body, headers, @@ -10825,7 +10825,7 @@ var require_mock_interceptor = __commonJS({ var require_mock_client = __commonJS({ "node_modules/undici/lib/mock/mock-client.js"(exports2, module2) { "use strict"; - var { promisify } = require("node:util"); + var { promisify: promisify2 } = require("node:util"); var Client = require_client(); var { buildMockDispatch } = require_mock_utils(); var { @@ -10865,7 +10865,7 @@ var require_mock_client = __commonJS({ return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { - await promisify(this[kOriginalClose])(); + await promisify2(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } @@ -10878,7 +10878,7 @@ var require_mock_client = __commonJS({ var require_mock_pool = __commonJS({ "node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) { "use strict"; - var { promisify } = require("node:util"); + var { promisify: promisify2 } = require("node:util"); var Pool = require_pool(); var { buildMockDispatch } = require_mock_utils(); var { @@ -10918,7 +10918,7 @@ var require_mock_pool = __commonJS({ return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { - await promisify(this[kOriginalClose])(); + await promisify2(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } @@ -10982,10 +10982,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path3, + Path: path4, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -11004,7 +11004,7 @@ var require_mock_agent = __commonJS({ "node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) { "use strict"; var { kClients } = require_symbols(); - var Agent = require_agent(); + var Agent3 = require_agent(); var { kAgent, kMockAgentSet, @@ -11031,7 +11031,7 @@ var require_mock_agent = __commonJS({ if (opts?.agent && typeof opts.agent.dispatch !== "function") { throw new InvalidArgumentError("Argument opts.agent must implement Agent"); } - const agent = opts?.agent ? opts.agent : new Agent(opts); + const agent = opts?.agent ? opts.agent : new Agent3(opts); this[kAgent] = agent; this[kClients] = agent[kClients]; this[kOptions] = buildMockOptions(opts); @@ -11135,9 +11135,9 @@ var require_global2 = __commonJS({ "use strict"; var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); - var Agent = require_agent(); + var Agent3 = require_agent(); if (getGlobalDispatcher() === void 0) { - setGlobalDispatcher(new Agent()); + setGlobalDispatcher(new Agent3()); } function setGlobalDispatcher(agent) { if (!agent || typeof agent.dispatch !== "function") { @@ -11254,7 +11254,7 @@ var require_retry = __commonJS({ var require_dump = __commonJS({ "node_modules/undici/lib/interceptor/dump.js"(exports2, module2) { "use strict"; - var util = require_util(); + var util2 = require_util(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var DecoratorHandler = require_decorator_handler(); var DumpHandler = class extends DecoratorHandler { @@ -11283,7 +11283,7 @@ var require_dump = __commonJS({ } // TODO: will require adjustment after new hooks are out onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const headers = util.parseHeaders(rawHeaders); + const headers = util2.parseHeaders(rawHeaders); const contentLength = headers["content-length"]; if (contentLength != null && contentLength > this.#maxSize) { throw new RequestAbortedError( @@ -11650,7 +11650,7 @@ var require_headers = __commonJS({ } = require_util2(); var { webidl } = require_webidl(); var assert = require("node:assert"); - var util = require("node:util"); + var util2 = require("node:util"); var kHeadersMap = /* @__PURE__ */ Symbol("headers map"); var kHeadersSortedMap = /* @__PURE__ */ Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { @@ -11746,12 +11746,12 @@ var require_headers = __commonJS({ append(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); - const exists2 = this[kHeadersMap].get(lowercaseName); - if (exists2) { + const exists3 = this[kHeadersMap].get(lowercaseName); + if (exists3) { const delimiter2 = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { - name: exists2.name, - value: `${exists2.value}${delimiter2}${value}` + name: exists3.name, + value: `${exists3.value}${delimiter2}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); @@ -11876,7 +11876,7 @@ var require_headers = __commonJS({ } } }; - var Headers2 = class _Headers { + var Headers3 = class _Headers { #guard; #headersList; constructor(init = void 0) { @@ -12009,9 +12009,9 @@ var require_headers = __commonJS({ } return this.#headersList[kHeadersSortedMap] = headers; } - [util.inspect.custom](depth, options) { + [util2.inspect.custom](depth, options) { options.depth ??= depth; - return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`; + return `Headers ${util2.formatWithOptions(options, this.#headersList.entries)}`; } static getHeadersGuard(o) { return o.#guard; @@ -12026,13 +12026,13 @@ var require_headers = __commonJS({ o.#headersList = list; } }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2; - Reflect.deleteProperty(Headers2, "getHeadersGuard"); - Reflect.deleteProperty(Headers2, "setHeadersGuard"); - Reflect.deleteProperty(Headers2, "getHeadersList"); - Reflect.deleteProperty(Headers2, "setHeadersList"); - iteratorMixin("Headers", Headers2, kHeadersSortedMap, 0, 1); - Object.defineProperties(Headers2.prototype, { + var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers3; + Reflect.deleteProperty(Headers3, "getHeadersGuard"); + Reflect.deleteProperty(Headers3, "setHeadersGuard"); + Reflect.deleteProperty(Headers3, "getHeadersList"); + Reflect.deleteProperty(Headers3, "setHeadersList"); + iteratorMixin("Headers", Headers3, kHeadersSortedMap, 0, 1); + Object.defineProperties(Headers3.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, @@ -12043,14 +12043,14 @@ var require_headers = __commonJS({ value: "Headers", configurable: true }, - [util.inspect.custom]: { + [util2.inspect.custom]: { enumerable: false } }); webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object") { const iterator2 = Reflect.get(V, Symbol.iterator); - if (!util.types.isProxy(V) && iterator2 === Headers2.prototype.entries) { + if (!util2.types.isProxy(V) && iterator2 === Headers3.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { @@ -12071,7 +12071,7 @@ var require_headers = __commonJS({ fill, // for test. compareHeaderName, - Headers: Headers2, + Headers: Headers3, HeadersList, getHeadersGuard, setHeadersGuard, @@ -12085,11 +12085,11 @@ var require_headers = __commonJS({ var require_response = __commonJS({ "node_modules/undici/lib/web/fetch/response.js"(exports2, module2) { "use strict"; - var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); + var { Headers: Headers3, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); var { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); - var util = require_util(); + var util2 = require_util(); var nodeUtil = require("node:util"); - var { kEnumerableProperty } = util; + var { kEnumerableProperty } = util2; var { isValidReasonPhrase, isCancelled, @@ -12163,7 +12163,7 @@ var require_response = __commonJS({ } init = webidl.converters.ResponseInit(init); this[kState] = makeResponse({}); - this[kHeaders] = new Headers2(kConstruct); + this[kHeaders] = new Headers3(kConstruct); setHeadersGuard(this[kHeaders], "response"); setHeadersList(this[kHeaders], this[kState].headersList); let bodyWithType = null; @@ -12219,7 +12219,7 @@ var require_response = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Response); - return !!this[kState].body && util.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { @@ -12407,7 +12407,7 @@ var require_response = __commonJS({ function fromInnerResponse(innerResponse, guard) { const response = new Response(kConstruct); response[kState] = innerResponse; - response[kHeaders] = new Headers2(kConstruct); + response[kHeaders] = new Headers3(kConstruct); setHeadersList(response[kHeaders], innerResponse.headersList); setHeadersGuard(response[kHeaders], guard); if (hasFinalizationRegistry && innerResponse.body?.stream) { @@ -12434,7 +12434,7 @@ var require_response = __commonJS({ if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) { return webidl.converters.BufferSource(V, prefix, name); } - if (util.isFormDataLike(V)) { + if (util2.isFormDataLike(V)) { return webidl.converters.FormData(V, prefix, name, { strict: false }); } if (V instanceof URLSearchParams) { @@ -12527,9 +12527,9 @@ var require_request2 = __commonJS({ "node_modules/undici/lib/web/fetch/request.js"(exports2, module2) { "use strict"; var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body(); - var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); + var { Headers: Headers3, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); - var util = require_util(); + var util2 = require_util(); var nodeUtil = require("node:util"); var { isValidHTTPToken, @@ -12546,7 +12546,7 @@ var require_request2 = __commonJS({ requestCache, requestDuplex } = require_constants3(); - var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util; + var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util2; var { kHeaders, kSignal, kState, kDispatcher } = require_symbols2(); var { webidl } = require_webidl(); var { URLSerializer } = require_data_url(); @@ -12791,11 +12791,11 @@ var require_request2 = __commonJS({ } } catch { } - util.addAbortListener(signal, abort); + util2.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }, abort); } } - this[kHeaders] = new Headers2(kConstruct); + this[kHeaders] = new Headers3(kConstruct); setHeadersList(this[kHeaders], request2.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { @@ -12974,7 +12974,7 @@ var require_request2 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Request); - return !!this[kState].body && util.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, _Request); @@ -12998,7 +12998,7 @@ var require_request2 = __commonJS({ } const acRef = new WeakRef(ac); list.add(acRef); - util.addAbortListener( + util2.addAbortListener( ac.signal, buildAbort(acRef) ); @@ -13084,7 +13084,7 @@ var require_request2 = __commonJS({ const request2 = new Request(kConstruct); request2[kState] = innerRequest; request2[kSignal] = signal; - request2[kHeaders] = new Headers2(kConstruct); + request2[kHeaders] = new Headers3(kConstruct); setHeadersList(request2[kHeaders], innerRequest.headersList); setHeadersGuard(request2[kHeaders], guard); return request2; @@ -13277,7 +13277,7 @@ var require_fetch = __commonJS({ subresourceSet } = require_constants3(); var EE = require("node:events"); - var { Readable, pipeline, finished } = require("node:stream"); + var { Readable, pipeline: pipeline2, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); var { getGlobalDispatcher } = require_global2(); @@ -14062,7 +14062,7 @@ var require_fetch = __commonJS({ fetchParams.controller.abort(reason); } }; - const stream = new ReadableStream( + const stream2 = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; @@ -14076,7 +14076,7 @@ var require_fetch = __commonJS({ type: "bytes" } ); - response.body = { stream, source: null, length: null }; + response.body = { stream: stream2, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { @@ -14111,7 +14111,7 @@ var require_fetch = __commonJS({ if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } - if (isErrored(stream)) { + if (isErrored(stream2)) { fetchParams.controller.terminate(); return; } @@ -14123,13 +14123,13 @@ var require_fetch = __commonJS({ function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; - if (isReadable(stream)) { + if (isReadable(stream2)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { - if (isReadable(stream)) { + if (isReadable(stream2)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); @@ -14221,7 +14221,7 @@ var require_fetch = __commonJS({ status, statusText, headersList, - body: decoders.length ? pipeline(this.body, ...decoders, (err) => { + body: decoders.length ? pipeline2(this.body, ...decoders, (err) => { if (err) { this.onError(err); } @@ -14682,8 +14682,8 @@ var require_util4 = __commonJS({ fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; - const stream = blob.stream(); - const reader = stream.getReader(); + const stream2 = blob.stream(); + const reader = stream2.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; @@ -15342,8 +15342,8 @@ var require_cache = __commonJS({ const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { - const stream = innerResponse.body.stream; - const reader = stream.getReader(); + const stream2 = innerResponse.body.stream; + const reader = stream2.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); @@ -15866,9 +15866,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path3) { - for (let i = 0; i < path3.length; ++i) { - const code = path3.charCodeAt(i); + function validateCookiePath(path4) { + for (let i = 0; i < path4.length; ++i) { + const code = path4.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -16122,10 +16122,10 @@ var require_cookies = __commonJS({ var { parseSetCookie } = require_parse(); var { stringify } = require_util6(); var { webidl } = require_webidl(); - var { Headers: Headers2 } = require_headers(); + var { Headers: Headers3 } = require_headers(); function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers3, { strict: false }); const cookie = headers.get("cookie"); const out = {}; if (!cookie) { @@ -16138,7 +16138,7 @@ var require_cookies = __commonJS({ return out; } function deleteCookie(headers, name, attributes) { - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers3, { strict: false }); const prefix = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.DOMString(name, prefix, "name"); @@ -16152,7 +16152,7 @@ var require_cookies = __commonJS({ } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers3, { strict: false }); const cookies = headers.getSetCookie(); if (!cookies) { return []; @@ -16161,7 +16161,7 @@ var require_cookies = __commonJS({ } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers3, { strict: false }); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { @@ -16763,13 +16763,13 @@ var require_frame = __commonJS({ "use strict"; var { maxUnsigned16Bit } = require_constants5(); var BUFFER_SIZE = 16386; - var crypto; + var crypto2; var buffer = null; var bufIdx = BUFFER_SIZE; try { - crypto = require("node:crypto"); + crypto2 = require("node:crypto"); } catch { - crypto = { + crypto2 = { // not full compatibility, but minimum. randomFillSync: function randomFillSync(buffer2, _offset, _size) { for (let i = 0; i < buffer2.length; ++i) { @@ -16782,7 +16782,7 @@ var require_frame = __commonJS({ function generateMask() { if (bufIdx === BUFFER_SIZE) { bufIdx = 0; - crypto.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); + crypto2.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); } return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]; } @@ -16851,12 +16851,12 @@ var require_connection = __commonJS({ var { CloseEvent } = require_events(); var { makeRequest } = require_request2(); var { fetching } = require_fetch(); - var { Headers: Headers2, getHeadersList } = require_headers(); + var { Headers: Headers3, getHeadersList } = require_headers(); var { getDecodeSplit } = require_util2(); var { WebsocketFrameSend } = require_frame(); - var crypto; + var crypto2; try { - crypto = require("node:crypto"); + crypto2 = require("node:crypto"); } catch { } function establishWebSocketConnection(url, protocols, client, ws, onEstablish, options) { @@ -16873,10 +16873,10 @@ var require_connection = __commonJS({ redirect: "error" }); if (options.headers) { - const headersList = getHeadersList(new Headers2(options.headers)); + const headersList = getHeadersList(new Headers3(options.headers)); request2.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request2.headersList.append("sec-websocket-key", keyValue); request2.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16906,7 +16906,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -18148,7 +18148,7 @@ ${value}`; var require_eventsource = __commonJS({ "node_modules/undici/lib/web/eventsource/eventsource.js"(exports2, module2) { "use strict"; - var { pipeline } = require("node:stream"); + var { pipeline: pipeline2 } = require("node:stream"); var { fetching } = require_fetch(); var { makeRequest } = require_request2(); var { webidl } = require_webidl(); @@ -18306,7 +18306,7 @@ var require_eventsource = __commonJS({ )); } }); - pipeline( + pipeline2( response.body.stream, eventSourceStream, (error3) => { @@ -18449,12 +18449,12 @@ var require_undici = __commonJS({ var Dispatcher = require_dispatcher(); var Pool = require_pool(); var BalancedPool = require_balanced_pool(); - var Agent = require_agent(); - var ProxyAgent2 = require_proxy_agent(); + var Agent3 = require_agent(); + var ProxyAgent3 = require_proxy_agent(); var EnvHttpProxyAgent = require_env_http_proxy_agent(); var RetryAgent = require_retry_agent(); var errors = require_errors(); - var util = require_util(); + var util2 = require_util(); var { InvalidArgumentError } = errors; var api = require_api(); var buildConnector = require_connect(); @@ -18472,8 +18472,8 @@ var require_undici = __commonJS({ module2.exports.Client = Client; module2.exports.Pool = Pool; module2.exports.BalancedPool = BalancedPool; - module2.exports.Agent = Agent; - module2.exports.ProxyAgent = ProxyAgent2; + module2.exports.Agent = Agent3; + module2.exports.ProxyAgent = ProxyAgent3; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.RetryAgent = RetryAgent; module2.exports.RetryHandler = RetryHandler; @@ -18489,8 +18489,8 @@ var require_undici = __commonJS({ module2.exports.buildConnector = buildConnector; module2.exports.errors = errors; module2.exports.util = { - parseHeaders: util.parseHeaders, - headerNameToString: util.headerNameToString + parseHeaders: util2.parseHeaders, + headerNameToString: util2.headerNameToString }; function makeDispatcher(fn) { return (url, opts, handler2) => { @@ -18508,16 +18508,16 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path3 = opts.path; + let path4 = opts.path; if (!opts.path.startsWith("/")) { - path3 = `/${path3}`; + path4 = `/${path4}`; } - url = new URL(util.parseOrigin(url).origin + path3); + url = new URL(util2.parseOrigin(url).origin + path4); } else { if (!opts) { opts = typeof url === "object" ? url : {}; } - url = util.parseURL(url); + url = util2.parseURL(url); } const { agent, dispatcher = getGlobalDispatcher() } = opts; if (agent) { @@ -18583,5753 +18583,2987 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js -var require_utils2 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; - function toCommandValue2(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; - } - return JSON.stringify(input); - } - exports2.toCommandValue = toCommandValue2; - function toCommandProperties2(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; - } - exports2.toCommandProperties = toCommandProperties2; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js -var require_command = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issue = exports2.issueCommand = void 0; - var os5 = __importStar(require("os")); - var utils_1 = require_utils2(); - function issueCommand2(command, properties, message) { - const cmd = new Command2(command, properties, message); - process.stdout.write(cmd.toString() + os5.EOL); - } - exports2.issueCommand = issueCommand2; - function issue2(name, message = "") { - issueCommand2(name, {}, message); - } - exports2.issue = issue2; - var CMD_STRING2 = "::"; - var Command2 = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING2 + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty2(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING2}${escapeData2(this.message)}`; - return cmdStr; - } + var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; - function escapeData2(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty2(s) { - return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); - } + module2.exports = debug2; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js -var require_file_command = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar(require("crypto")); - var fs4 = __importStar(require("fs")); - var os5 = __importStar(require("os")); - var utils_1 = require_utils2(); - function issueFileCommand2(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs4.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs4.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.EOL}`, { - encoding: "utf8" - }); - } - exports2.issueFileCommand = issueFileCommand2; - function prepareKeyValueMessage2(key, value) { - const delimiter2 = `ghadelimiter_${crypto.randomUUID()}`; - const convertedValue = (0, utils_1.toCommandValue)(value); - if (key.includes(delimiter2)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter2}"`); - } - if (convertedValue.includes(delimiter2)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter2}"`); - } - return `${key}<<${delimiter2}${os5.EOL}${convertedValue}${os5.EOL}${delimiter2}`; - } - exports2.prepareKeyValueMessage = prepareKeyValueMessage2; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants6(); + var debug2 = require_debug(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug2(name, index, value); + t[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); } }); -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; - function getProxyUrl2(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new URL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new URL(`http://${proxyVar}`); - } - } else { - return void 0; - } - } - exports2.getProxyUrl = getProxyUrl2; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + if (typeof options !== "object") { + return looseOption; } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - exports2.checkBypass = checkBypass; - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } + return options; + }; + module2.exports = parseOptions; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; + var debug2 = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6(); + var { safeRe: re, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version, options) { + options = parseOptions(options); + if (version instanceof _SemVer) { + if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { + return version; + } else { + version = version.version; } + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar(require("http")); - var https = __importStar(require("https")); - var pm = __importStar(require_proxy()); - var tunnel2 = __importStar(require_tunnel2()); - var HttpCodes2; - (function(HttpCodes3) { - HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; - HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; - HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; - HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; - HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; - HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; - HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; - HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; - HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; - HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; - HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes2 = exports2.HttpCodes || (exports2.HttpCodes = {})); - var Headers2; - (function(Headers3) { - Headers3["Accept"] = "accept"; - Headers3["ContentType"] = "content-type"; - })(Headers2 = exports2.Headers || (exports2.Headers = {})); - var MediaTypes2; - (function(MediaTypes3) { - MediaTypes3["ApplicationJson"] = "application/json"; - })(MediaTypes2 = exports2.MediaTypes || (exports2.MediaTypes = {})); - function getProxyUrl2(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - exports2.getProxyUrl = getProxyUrl2; - var HttpRedirectCodes2 = [ - HttpCodes2.MovedPermanently, - HttpCodes2.ResourceMoved, - HttpCodes2.SeeOther, - HttpCodes2.TemporaryRedirect, - HttpCodes2.PermanentRedirect - ]; - var HttpResponseRetryCodes2 = [ - HttpCodes2.BadGateway, - HttpCodes2.ServiceUnavailable, - HttpCodes2.GatewayTimeout - ]; - var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; - var ExponentialBackoffCeiling = 10; - var ExponentialBackoffTimeSlice = 5; - var HttpClientError = class _HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = "HttpClientError"; - this.statusCode = statusCode; - Object.setPrototypeOf(this, _HttpClientError.prototype); - } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve) => __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", () => { - resolve(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter2(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent2, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent2; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes2.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes2.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.ContentType, MediaTypes2.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info2 = this._prepareRequest(verb, parsedUrl, headers); - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info2, data); - if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { - let authenticationHandler; - for (const handler2 of this.handlers) { - if (handler2.canHandleAuthentication(response)) { - authenticationHandler = handler2; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info2, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes2.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + debug2("SemVer", version, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; } - info2 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info2, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes2.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); } - } while (numTries < maxTries); - return response; - }); + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; } - this._disposed = true; + return this.version; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info2, data) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve(res); - } - } - this.requestRawWithCallback(info2, data, callbackForResult); - }); - }); + toString() { + return this.version; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info2, data, onResult) { - if (typeof data === "string") { - if (!info2.options.headers) { - info2.options.headers = {}; - } - info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info2.httpModule.request(info2.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); - }); - let socket; - req.on("socket", (sock) => { - socket = sock; - }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); + compare(other) { + debug2("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; } - handleResult(new Error(`Request timeout: ${info2.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + other = new _SemVer(other, this.options); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (other.version === this.version) { + return 0; } + return this.compareMain(other) || this.comparePre(other); } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info2 = {}; - info2.parsedUrl = requestUrl; - const usingSsl = info2.parsedUrl.protocol === "https:"; - info2.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info2.options = {}; - info2.options.host = info2.parsedUrl.hostname; - info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort; - info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || ""); - info2.options.method = method; - info2.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info2.options.headers["user-agent"] = this.userAgent; - } - info2.options.agent = this._getAgent(info2.parsedUrl); - if (this.handlers) { - for (const handler2 of this.handlers) { - handler2.prepareRequest(info2.options); - } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - return info2; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers || {})); + if (this.major < other.major) { + return -1; } - return lowercaseKeys2(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; + if (this.major > other.major) { + return 1; } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + if (this.minor < other.minor) { + return -1; } - if (this._keepAlive && !useProxy) { - agent = this._agent; + if (this.minor > other.minor) { + return 1; } - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === "https:"; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; + if (this.patch < other.patch) { + return -1; } - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; + if (this.patch > other.patch) { + return 1; } - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; + return 0; + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; } - return agent; + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug2("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); } - _performExponentialBackoff(retryNumber) { - return __awaiter2(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve) => setTimeout(() => resolve(), ms)); - }); + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug2("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); } - _processResponse(res, options) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes2.NotFound) { - resolve(response); + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; } } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); } - response.result = obj; + this.prerelease.push(base); } - response.headers = res.message.headers; - } catch (err) { } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } } else { - msg = `Failed request: (${statusCode})`; + this.prerelease = prerelease; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve(response); } - })); - }); + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + module2.exports = SemVer; } }); -// node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/semver/functions/parse.js +var require_parse2 = __commonJS({ + "node_modules/semver/functions/parse.js"(exports2, module2) { "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; + var SemVer = require_semver(); + var parse2 = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + try { + return new SemVer(version, options); + } catch (er) { + if (!throwErrors) { + return null; } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; + throw er; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + }; + module2.exports = parse2; + } +}); + +// node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "node_modules/semver/functions/valid.js"(exports2, module2) { + "use strict"; + var parse2 = require_parse2(); + var valid2 = (version, options) => { + const v = parse2(version, options); + return v ? v.version : null; + }; + module2.exports = valid2; + } +}); + +// node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "node_modules/semver/functions/clean.js"(exports2, module2) { + "use strict"; + var parse2 = require_parse2(); + var clean2 = (version, options) => { + const s = parse2(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; + }; + module2.exports = clean2; + } +}); + +// node_modules/semver/functions/inc.js +var require_inc = __commonJS({ + "node_modules/semver/functions/inc.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var inc = (version, release, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = void 0; } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler2 = class { - constructor(token) { - this.token = token; + module2.exports = inc; + } +}); + +// node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "node_modules/semver/functions/diff.js"(exports2, module2) { + "use strict"; + var parse2 = require_parse2(); + var diff = (version1, version2) => { + const v1 = parse2(version1, null, true); + const v2 = parse2(version2, null, true); + const comparison = v1.compare(v2); + if (comparison === 0) { + return null; } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v1 : v2; + const lowVersion = v1Higher ? v2 : v1; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } + return "patch"; } - options.headers["Authorization"] = `Bearer ${this.token}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + const prefix = highHasPre ? "pre" : ""; + if (v1.major !== v2.major) { + return prefix + "major"; } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + if (v1.minor !== v2.minor) { + return prefix + "minor"; + } + if (v1.patch !== v2.patch) { + return prefix + "patch"; + } + return "prerelease"; + }; + module2.exports = diff; + } +}); + +// node_modules/semver/functions/major.js +var require_major = __commonJS({ + "node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var major = (a, loose) => new SemVer(a, loose).major; + module2.exports = major; + } +}); + +// node_modules/semver/functions/minor.js +var require_minor = __commonJS({ + "node_modules/semver/functions/minor.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var minor = (a, loose) => new SemVer(a, loose).minor; + module2.exports = minor; + } +}); + +// node_modules/semver/functions/patch.js +var require_patch = __commonJS({ + "node_modules/semver/functions/patch.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var patch = (a, loose) => new SemVer(a, loose).patch; + module2.exports = patch; + } +}); + +// node_modules/semver/functions/prerelease.js +var require_prerelease = __commonJS({ + "node_modules/semver/functions/prerelease.js"(exports2, module2) { + "use strict"; + var parse2 = require_parse2(); + var prerelease = (version, options) => { + const parsed = parse2(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + }; + module2.exports = prerelease; + } +}); + +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); + module2.exports = compare; + } +}); + +// node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a, b, loose) => compare(b, a, loose); + module2.exports = rcompare; + } +}); + +// node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "node_modules/semver/functions/compare-loose.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var compareLoose = (a, b) => compare(a, b, true); + module2.exports = compareLoose; + } +}); + +// node_modules/semver/functions/compare-build.js +var require_compare_build = __commonJS({ + "node_modules/semver/functions/compare-build.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose); + const versionB = new SemVer(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module2.exports = compareBuild; + } +}); + +// node_modules/semver/functions/sort.js +var require_sort = __commonJS({ + "node_modules/semver/functions/sort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); + module2.exports = sort; + } +}); + +// node_modules/semver/functions/rsort.js +var require_rsort = __commonJS({ + "node_modules/semver/functions/rsort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); + module2.exports = rsort; + } +}); + +// node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gt2 = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt2; + } +}); + +// node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lt = (a, b, loose) => compare(a, b, loose) < 0; + module2.exports = lt; + } +}); + +// node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a, b, loose) => compare(a, b, loose) === 0; + module2.exports = eq; + } +}); + +// node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var neq = (a, b, loose) => compare(a, b, loose) !== 0; + module2.exports = neq; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module2.exports = gte; + } +}); + +// node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a, b, loose) => compare(a, b, loose) <= 0; + module2.exports = lte; + } +}); + +// node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + var neq = require_neq(); + var gt2 = require_gt(); + var gte = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a === b; + case "!==": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a !== b; + case "": + case "=": + case "==": + return eq(a, b, loose); + case "!=": + return neq(a, b, loose); + case ">": + return gt2(a, b, loose); + case ">=": + return gte(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); } }; - exports2.BearerCredentialHandler = BearerCredentialHandler2; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + module2.exports = cmp; + } +}); + +// node_modules/semver/functions/coerce.js +var require_coerce = __commonJS({ + "node_modules/semver/functions/coerce.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var parse2 = require_parse2(); + var { safeRe: re, t } = require_re(); + var coerce = (version, options) => { + if (version instanceof SemVer) { + return version; } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + if (typeof version === "number") { + version = String(version); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + if (typeof version !== "string") { + return null; } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + options = options || {}; + let match = null; + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + } else { + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; + let next; + while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; + } + coerceRtlRegex.lastIndex = -1; } + if (match === null) { + return null; + } + const major = match[2]; + const minor = match[3] || "0"; + const patch = match[4] || "0"; + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; + const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; + return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options); }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + module2.exports = coerce; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { +// node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + "node_modules/semver/internal/lrucache.js"(exports2, module2) { "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); + var LRUCache = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient2 = class _OidcClient { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry - }; - return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); - } - static getRequestToken() { - const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; - if (!token) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); - } - return token; - } - static getIDTokenUrl() { - const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; - if (!runtimeUrl) { - throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); - } - return runtimeUrl; - } - static getCall(id_token_url) { - var _a; - return __awaiter2(this, void 0, void 0, function* () { - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error3) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error3.statusCode} - - Error Message: ${error3.message}`); - }); - const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; - if (!id_token) { - throw new Error("Response json body do not have ID Token field"); - } - return id_token; - }); } - static getIDToken(audience) { - return __awaiter2(this, void 0, void 0, function* () { - try { - let id_token_url = _OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - (0, core_1.debug)(`ID token url is ${id_token_url}`); - const id_token = yield _OidcClient.getCall(id_token_url); - (0, core_1.setSecret)(id_token); - return id_token; - } catch (error3) { - throw new Error(`Error message: ${error3.message}`); + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); } - }); + this.map.set(key, value); + } + return this; } }; - exports2.OidcClient = OidcClient2; + module2.exports = LRUCache; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js"(exports2) { +// node_modules/semver/classes/range.js +var require_range = __commonJS({ + "node_modules/semver/classes/range.js"(exports2, module2) { "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + var SPACE_CHARACTERS = /\s+/g; + var Range = class _Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c) => !isNullSet(c[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c]; + break; + } + } + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0; - var os_1 = require("os"); - var fs_1 = require("fs"); - var { access: access2, appendFile: appendFile2, writeFile: writeFile2 } = fs_1.promises; - exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; - exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; - var Summary2 = class { - constructor() { - this._buffer = ""; + this.formatted = void 0; } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter2(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[exports2.SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += "||"; + } + const comps = this.set[i]; + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += " "; + } + this.formatted += comps[k].toString().trim(); + } } - try { - yield access2(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + return this.formatted; + } + format() { + return this.range; + } + toString() { + return this.range; + } + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug2("hyphen replace", range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug2("comparator trim", range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug2("tilde trim", range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug2("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug2("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); + } + debug2("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; } - this._filePath = pathFromEnv; - return this._filePath; - }); + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache.set(memoKey, result); + return result; } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); } - return `<${tag}${htmlAttrs}>${content}`; + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter2(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile2 : appendFile2; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter2(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); - } - }; - var _summary2 = new Summary2(); - exports2.markdownSummary = _summary2; - exports2.summary = _summary2; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path3 = __importStar(require("path")); - function toPosixPath2(pth) { - return pth.replace(/[\\]/g, "/"); - } - exports2.toPosixPath = toPosixPath2; - function toWin32Path2(pth) { - return pth.replace(/[/]/g, "\\"); - } - exports2.toWin32Path = toWin32Path2; - function toPlatformPath2(pth) { - return pth.replace(/[/\\]/g, path3.sep); - } - exports2.toPlatformPath = toPlatformPath2; - } -}); - -// node_modules/@actions/io/lib/io-util.js -var require_io_util = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + // if ANY of the sets match ALL of its comparators, then pass + test(version) { + if (!version) { + return false; } - function rejected(value) { + if (typeof version === "string") { try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rename = exports2.readlink = exports2.readdir = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs4 = __importStar(require("fs")); - var path3 = __importStar(require("path")); - _a = fs4.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function exists2(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true; } - throw err; } - return true; - }); - } - exports2.exists = exists2; - function isDirectory2(fsPath, useStat = false) { - return __awaiter2(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); - }); - } - exports2.isDirectory = isDirectory2; - function isRooted2(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); + return false; } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + }; + module2.exports = Range; + var LRU = require_lrucache(); + var cache = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug2 = require_debug(); + var SemVer = require_semver(); + var { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants6(); + var isNullSet = (c) => c.value === "<0.0.0-0"; + var isAny = (c) => c.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); } - return p.startsWith("/"); - } - exports2.isRooted = isRooted2; - function tryGetExecutablePath2(filePath, extensions) { - return __awaiter2(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield exports2.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } + return result; + }; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], ""); + debug2("comp", comp, options); + comp = replaceCarets(comp, options); + debug2("caret", comp); + comp = replaceTildes(comp, options); + debug2("tildes", comp); + comp = replaceXRanges(comp, options); + debug2("xrange", comp); + comp = replaceStars(comp, options); + debug2("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, (_, M, m, p, pr) => { + debug2("tilde", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug2("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path3.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } + debug2("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug2("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug2("caret", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === "0") { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; } else { - if (isUnixExecutable(stats)) { - return filePath; - } + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield exports2.stat(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } else if (pr) { + debug2("replaceCaret pr", pr); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path3.dirname(filePath); - const upperName = path3.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path3.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; + } else { + debug2("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; } else { - if (isUnixExecutable(stats)) { - return filePath; - } + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } } - return ""; + debug2("caret return", ret); + return ret; }); - } - exports2.tryGetExecutablePath = tryGetExecutablePath2; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); - } - return p.replace(/\/\/+/g, "/"); - } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); - } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } - exports2.getCmdPath = getCmdPath; - } -}); - -// node_modules/@actions/io/lib/io.js -var require_io = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + var replaceXRanges = (comp, options) => { + debug2("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); }; - 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 childProcess = __importStar(require("child_process")); - var path3 = __importStar(require("path")); - var util_1 = require("util"); - var ioUtil = __importStar(require_io_util()); - var exec = util_1.promisify(childProcess.exec); - var execFile = util_1.promisify(childProcess.execFile); - function cp(source, dest, options = {}) { - return __awaiter2(this, void 0, void 0, function* () { - const { force, recursive, copySourceDirectory } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - if (destStat && destStat.isFile() && !force) { - return; - } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug2("xRange", comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; } else { - yield cpDirRecursive(source, newDest, 0, force); + ret = "*"; } - } else { - if (path3.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); + } else if (gtlt && anyX) { + if (xm) { + m = 0; } - yield copyFile2(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter2(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path3.join(dest, path3.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); + p = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; } else { - throw new Error("Destination already exists"); + m = +m + 1; } } - } - yield mkdirP(path3.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter2(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); - } - try { - const cmdPath = ioUtil.getCmdPath(); - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath } - }); - } else { - yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath } - }); - } - } catch (err) { - if (err.code !== "ENOENT") - throw err; - } - try { - yield ioUtil.unlink(inputPath); - } catch (err) { - if (err.code !== "ENOENT") - throw err; - } - } else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } catch (err) { - if (err.code !== "ENOENT") - throw err; - return; + if (gtlt === "<") { + pr = "-0"; } - if (isDir) { - yield execFile(`rm`, [`-rf`, `${inputPath}`]); - } else { - yield ioUtil.unlink(inputPath); - } - } - }); - } - exports2.rmRF = rmRF; - function mkdirP(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - exports2.mkdirP = mkdirP; - function which2(tool, check) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which2(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; } - return ""; + debug2("xRange return", ret); + return ret; }); - } - exports2.which = which2; - function findInPath(tool) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path3.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - if (tool.includes(path3.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path3.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } + }; + var replaceStars = (comp, options) => { + debug2("replaceStars", comp, options); + return comp.trim().replace(re[t.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug2("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false; } - return matches; - }); - } - exports2.findInPath = findInPath; - function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); - return { force, recursive, copySourceDirectory }; - } - function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter2(this, void 0, void 0, function* () { - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } else { - yield copyFile2(srcFile, destFile, force); + } + if (version.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set.length; i++) { + debug2(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile2(srcFile, destFile, force) { - return __awaiter2(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } catch (e) { - if (e.code === "EPERM") { - yield ioUtil.chmod(destFile, "0666"); - yield ioUtil.unlink(destFile); + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } } - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); - } else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); } - }); - } + return false; + } + return true; + }; } }); -// node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner = __commonJS({ - "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { +// node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os5 = __importStar(require("os")); - var events = __importStar(require("events")); - var child = __importStar(require("child_process")); - var path3 = __importStar(require("path")); - var io = __importStar(require_io()); - var ioUtil = __importStar(require_io_util()); - var timers_1 = require("timers"); - var IS_WINDOWS3 = process.platform === "win32"; - var ToolRunner2 = class extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? "" : "[command]"; - if (IS_WINDOWS3) { - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } + comp = comp.value; } + } + comp = comp.trim().split(/\s+/).join(" "); + debug2("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } + this.value = this.operator + this.semver.version; } - return cmd; + debug2("comp", this); } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os5.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - s = s.substring(n + os5.EOL.length); - n = s.indexOf(os5.EOL); - } - return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); } - } - _getSpawnFileName() { - if (IS_WINDOWS3) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS3) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m[2], this.options.loose); } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + toString() { + return this.value; } - _windowsQuoteCmdArg(arg) { - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - if (!arg) { - return '""'; - } - const cmdSpecialChars = [ - " ", - " ", - "&", - "(", - ")", - "[", - "]", - "{", - "}", - "^", - "=", - ";", - "!", - "'", - "+", - ",", - "`", - "~", - "|", - "<", - ">", - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some((x) => x === char)) { - needsQuotes = true; - break; - } - } - if (!needsQuotes) { - return arg; + test(version) { + debug2("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; - } else { - quoteHit = false; + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _uvQuoteCmdArg(arg) { - if (!arg) { - return '""'; - } - if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { - return arg; - } - if (!arg.includes('"') && !arg.includes("\\")) { - return `"${arg}"`; - } - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === "\\") { - reverse += "\\"; - } else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += "\\"; - } else { - quoteHit = false; - } - } - reverse += '"'; - return reverse.split("").reverse().join(""); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 1e4 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; + return cmp(version, this.operator, this.semver, this.options); } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter2(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS3 && this.toolPath.includes("\\"))) { - this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`); - this._debug("arguments:"); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os5.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on("debug", (message) => { - this._debug(message); - }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - } - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ""; - if (cp.stdout) { - cp.stdout.on("data", (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - let errbuffer = ""; - if (cp.stderr) { - cp.stderr.on("data", (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on("error", (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on("exit", (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on("close", (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on("done", (error3, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error3) { - reject(error3); - } else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error("child process missing stdin"); - } - cp.stdin.end(this.options.input); - } - })); - }); - } - }; - exports2.ToolRunner = ToolRunner2; - function argStringToArray2(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ""; - function append(c) { - if (escaped && c !== '"') { - arg += "\\"; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } else { - append(c); + if (this.operator === "") { + if (this.value === "") { + return true; } - continue; - } - if (c === "\\" && escaped) { - append(c); - continue; - } - if (c === "\\" && inQuotes) { - escaped = true; - continue; - } - if (c === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; - } - exports2.argStringToArray = argStringToArray2; - var ExecState = class _ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; - this.processError = ""; - this.processExitCode = 0; - this.processExited = false; - this.processStderr = false; - this.delay = 1e4; - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error("toolPath must not be empty"); + return new Range(this.value, options).test(comp.semver); } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; } - } - CheckComplete() { - if (this.done) { - return; + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; } - } - _debug(message) { - this.emit("debug", message); - } - _setResult() { - let error3; - if (this.processExited) { - if (this.processError) { - error3 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; } - this.done = true; - this.emit("done", error3, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; } - state._setResult(); + return false; } }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t } = require_re(); + var cmp = require_cmp(); + var debug2 = require_debug(); + var SemVer = require_semver(); + var Range = require_range(); } }); -// node_modules/@actions/exec/lib/exec.js -var require_exec = __commonJS({ - "node_modules/@actions/exec/lib/exec.js"(exports2) { +// node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "node_modules/semver/functions/satisfies.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + var Range = require_range(); + var satisfies3 = (version, range, options) => { + try { + range = new Range(range, options); + } catch (er) { + return false; } - __setModuleDefault(result, mod); - return result; + return range.test(version); }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); + module2.exports = satisfies3; + } +}); + +// node_modules/semver/ranges/to-comparators.js +var require_to_comparators = __commonJS({ + "node_modules/semver/ranges/to-comparators.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); + module2.exports = toComparators; + } +}); + +// node_modules/semver/ranges/max-satisfying.js +var require_max_satisfying = __commonJS({ + "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range(); + var maxSatisfying = (versions, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); } } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); }); + return max; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExecOutput = exports2.exec = void 0; - var string_decoder_1 = require("string_decoder"); - var tr = __importStar(require_toolrunner()); - function exec(commandLine, args, options) { - return __awaiter2(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); - } - exports2.exec = exec; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter2(this, void 0, void 0, function* () { - let stdout = ""; - let stderr = ""; - const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); - const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); - const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { - stderr += stderrDecoder.write(data); - if (originalStdErrListener) { - originalStdErrListener(data); - } - }; - const stdOutListener = (data) => { - stdout += stdoutDecoder.write(data); - if (originalStdoutListener) { - originalStdoutListener(data); - } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; + module2.exports = maxSatisfying; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { +// node_modules/semver/ranges/min-satisfying.js +var require_min_satisfying = __commonJS({ + "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + var SemVer = require_semver(); + var Range = require_range(); + var minSatisfying = (versions, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!min || minSV.compare(v) === 1) { + min = v; + minSV = new SemVer(min, options); } } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); }); + return min; }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; - var os_1 = __importDefault(require("os")); - var exec = __importStar(require_exec()); - var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; - const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; - return { - name, - version - }; - }); - var getLinuxInfo = () => __awaiter2(void 0, void 0, void 0, function* () { - const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version - }; - }); - exports2.platform = os_1.default.platform(); - exports2.arch = os_1.default.arch(); - exports2.isWindows = exports2.platform === "win32"; - exports2.isMacOS = exports2.platform === "darwin"; - exports2.isLinux = exports2.platform === "linux"; - function getDetails() { - return __awaiter2(this, void 0, void 0, function* () { - return Object.assign(Object.assign({}, yield exports2.isWindows ? getWindowsInfo() : exports2.isMacOS ? getMacOsInfo() : getLinuxInfo()), { - platform: exports2.platform, - arch: exports2.arch, - isWindows: exports2.isWindows, - isMacOS: exports2.isMacOS, - isLinux: exports2.isLinux - }); - }); - } - exports2.getDetails = getDetails; + module2.exports = minSatisfying; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js"(exports2) { +// node_modules/semver/ranges/min-version.js +var require_min_version = __commonJS({ + "node_modules/semver/ranges/min-version.js"(exports2, module2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + var SemVer = require_semver(); + var Range = require_range(); + var gt2 = require_gt(); + var minVersion = (range, loose) => { + range = new Range(range, loose); + let minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + minver = null; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let setMin = null; + comparators.forEach((comparator) => { + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!setMin || gt2(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); } + }); + if (setMin && (!minver || gt2(minver, setMin))) { + minver = setMin; } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils2(); - var os5 = __importStar(require("os")); - var path3 = __importStar(require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode2; - (function(ExitCode3) { - ExitCode3[ExitCode3["Success"] = 0] = "Success"; - ExitCode3[ExitCode3["Failure"] = 1] = "Failure"; - })(ExitCode2 || (exports2.ExitCode = ExitCode2 = {})); - function exportVariable(name, val) { - const convertedVal = (0, utils_1.toCommandValue)(val); - process.env[name] = convertedVal; - const filePath = process.env["GITHUB_ENV"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); - } - (0, command_1.issueCommand)("set-env", { name }, convertedVal); - } - exports2.exportVariable = exportVariable; - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - exports2.setSecret = setSecret2; - function addPath2(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - (0, file_command_1.issueFileCommand)("PATH", inputPath); - } else { - (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; - } - exports2.addPath = addPath2; - function getInput2(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); + if (minver && range.test(minver)) { + return minver; } - if (options && options.trimWhitespace === false) { - return val; + return null; + }; + module2.exports = minVersion; + } +}); + +// node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var validRange = (range, options) => { + try { + return new Range(range, options).range || "*"; + } catch (er) { + return null; } - return val.trim(); - } - exports2.getInput = getInput2; - function getMultilineInput(name, options) { - const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; + }; + module2.exports = validRange; + } +}); + +// node_modules/semver/ranges/outside.js +var require_outside = __commonJS({ + "node_modules/semver/ranges/outside.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var Range = require_range(); + var satisfies3 = require_satisfies(); + var gt2 = require_gt(); + var lt = require_lt(); + var lte = require_lte(); + var gte = require_gte(); + var outside = (version, range, hilo, options) => { + version = new SemVer(version, options); + range = new Range(range, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt2; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte; + ltfn = gt2; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - return inputs.map((input) => input.trim()); - } - exports2.getMultilineInput = getMultilineInput; - function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput2(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) + if (satisfies3(version, range, options)) { return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - exports2.getBooleanInput = getBooleanInput; - function setOutput(name, value) { - const filePath = process.env["GITHUB_OUTPUT"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - process.stdout.write(os5.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - exports2.setOutput = setOutput; - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - exports2.setCommandEcho = setCommandEcho; - function setFailed(message) { - process.exitCode = ExitCode2.Failure; - error3(message); - } - exports2.setFailed = setFailed; - function isDebug() { - return process.env["RUNNER_DEBUG"] === "1"; - } - exports2.isDebug = isDebug; - function debug2(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - exports2.debug = debug2; - function error3(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.error = error3; - function warning2(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.warning = warning2; - function notice(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.notice = notice; - function info2(message) { - process.stdout.write(message + os5.EOL); - } - exports2.info = info2; - function startGroup(name) { - (0, command_1.issue)("group", name); - } - exports2.startGroup = startGroup; - function endGroup() { - (0, command_1.issue)("endgroup"); - } - exports2.endGroup = endGroup; - function group(name, fn) { - return __awaiter2(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } finally { - endGroup(); + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let high = null; + let low = null; + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } - return result; - }); - } - exports2.group = group; - function saveState(name, value) { - const filePath = process.env["GITHUB_STATE"] || ""; - if (filePath) { - return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); - } - exports2.saveState = saveState; - function getState(name) { - return process.env[`STATE_${name}`] || ""; - } - exports2.getState = getState; - function getIDToken(aud) { - return __awaiter2(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - exports2.getIDToken = getIDToken; - var summary_1 = require_summary(); - Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { - return summary_1.summary; - } }); - var summary_2 = require_summary(); - Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { - return summary_2.markdownSummary; - } }); - var path_utils_1 = require_path_utils(); - Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { - return path_utils_1.toPosixPath; - } }); - Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { - return path_utils_1.toWin32Path; - } }); - Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { - return path_utils_1.toPlatformPath; - } }); - exports2.platform = __importStar(require_platform()); + return true; + }; + module2.exports = outside; } }); -// node_modules/semver/semver.js -var require_semver = __commonJS({ - "node_modules/semver/semver.js"(exports2, module2) { - exports2 = module2.exports = SemVer; - var debug2; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug2 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug2 = function() { - }; - } - exports2.SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var re = exports2.re = []; - var src = exports2.src = []; - var t = exports2.tokens = {}; - var R = 0; - function tok(n) { - t[n] = R++; - } - tok("NUMERICIDENTIFIER"); - src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*"; - tok("NUMERICIDENTIFIERLOOSE"); - src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+"; - tok("NONNUMERICIDENTIFIER"); - src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*"; - tok("MAINVERSION"); - src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")"; - tok("MAINVERSIONLOOSE"); - src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"; - tok("PRERELEASEIDENTIFIER"); - src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASEIDENTIFIERLOOSE"); - src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASE"); - src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))"; - tok("PRERELEASELOOSE"); - src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))"; - tok("BUILDIDENTIFIER"); - src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+"; - tok("BUILD"); - src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))"; - tok("FULL"); - tok("FULLPLAIN"); - src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?"; - src[t.FULL] = "^" + src[t.FULLPLAIN] + "$"; - tok("LOOSEPLAIN"); - src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?"; - tok("LOOSE"); - src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$"; - tok("GTLT"); - src[t.GTLT] = "((?:<|>)?=?)"; - tok("XRANGEIDENTIFIERLOOSE"); - src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; - tok("XRANGEIDENTIFIER"); - src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*"; - tok("XRANGEPLAIN"); - src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGEPLAINLOOSE"); - src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGE"); - src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$"; - tok("XRANGELOOSE"); - src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COERCE"); - src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; - tok("COERCERTL"); - re[t.COERCERTL] = new RegExp(src[t.COERCE], "g"); - tok("LONETILDE"); - src[t.LONETILDE] = "(?:~>?)"; - tok("TILDETRIM"); - src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+"; - re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g"); - var tildeTrimReplace = "$1~"; - tok("TILDE"); - src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$"; - tok("TILDELOOSE"); - src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("LONECARET"); - src[t.LONECARET] = "(?:\\^)"; - tok("CARETTRIM"); - src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+"; - re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g"); - var caretTrimReplace = "$1^"; - tok("CARET"); - src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$"; - tok("CARETLOOSE"); - src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COMPARATORLOOSE"); - src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$"; - tok("COMPARATOR"); - src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$"; - tok("COMPARATORTRIM"); - src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")"; - re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g"); - var comparatorTrimReplace = "$1$2$3"; - tok("HYPHENRANGE"); - src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$"; - tok("HYPHENRANGELOOSE"); - src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$"; - tok("STAR"); - src[t.STAR] = "(<|>)?=?\\s*\\*"; - for (i = 0; i < R; i++) { - debug2(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - } - } - var i; - exports2.parse = parse2; - function parse2(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version instanceof SemVer) { - return version; - } - if (typeof version !== "string") { - return null; - } - if (version.length > MAX_LENGTH) { - return null; +// node_modules/semver/ranges/gtr.js +var require_gtr = __commonJS({ + "node_modules/semver/ranges/gtr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var gtr = (version, range, options) => outside(version, range, ">", options); + module2.exports = gtr; + } +}); + +// node_modules/semver/ranges/ltr.js +var require_ltr = __commonJS({ + "node_modules/semver/ranges/ltr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var ltr = (version, range, options) => outside(version, range, "<", options); + module2.exports = ltr; + } +}); + +// node_modules/semver/ranges/intersects.js +var require_intersects = __commonJS({ + "node_modules/semver/ranges/intersects.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var intersects = (r1, r2, options) => { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2, options); + }; + module2.exports = intersects; + } +}); + +// node_modules/semver/ranges/simplify.js +var require_simplify = __commonJS({ + "node_modules/semver/ranges/simplify.js"(exports2, module2) { + "use strict"; + var satisfies3 = require_satisfies(); + var compare = require_compare(); + module2.exports = (versions, range, options) => { + const set = []; + let first = null; + let prev = null; + const v = versions.sort((a, b) => compare(a, b, options)); + for (const version of v) { + const included = satisfies3(version, range, options); + if (included) { + prev = version; + if (!first) { + first = version; + } + } else { + if (prev) { + set.push([first, prev]); + } + prev = null; + first = null; + } + } + if (first) { + set.push([first, null]); + } + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } } - var r = options.loose ? re[t.LOOSE] : re[t.FULL]; - if (!r.test(version)) { - return null; + const simplified = ranges.join(" || "); + const original = typeof range.raw === "string" ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; + }; + } +}); + +// node_modules/semver/ranges/subset.js +var require_subset = __commonJS({ + "node_modules/semver/ranges/subset.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var satisfies3 = require_satisfies(); + var compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; } - try { - return new SemVer(version, options); - } catch (er) { - return null; + sub = new Range(sub, options); + dom = new Range(dom, options); + let sawNonNull = false; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } } - } - exports2.valid = valid; - function valid(version, options) { - var v = parse2(version, options); - return v ? v.version : null; - } - exports2.clean = clean; - function clean(version, options) { - var s = parse2(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - } - exports2.SemVer = SemVer; - function SemVer(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + return true; + }; + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; } else { - version = version.version; + sub = minimumVersion; } - } else if (typeof version !== "string") { - throw new TypeError("Invalid Version: " + version); } - if (version.length > MAX_LENGTH) { - throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); - } - if (!(this instanceof SemVer)) { - return new SemVer(version, options); + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } } - debug2("SemVer", version, options); - this.options = options; - this.loose = !!options.loose; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - if (!m) { - throw new TypeError("Invalid Version: " + version); + const eqSet = /* @__PURE__ */ new Set(); + let gt2, lt; + for (const c of sub) { + if (c.operator === ">" || c.operator === ">=") { + gt2 = higherGT(gt2, c, options); + } else if (c.operator === "<" || c.operator === "<=") { + lt = lowerLT(lt, c, options); + } else { + eqSet.add(c.semver); + } } - this.raw = version; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); + if (eqSet.size > 1) { + return null; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + let gtltComp; + if (gt2 && lt) { + gtltComp = compare(gt2.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt.operator !== "<=")) { + return null; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + for (const eq of eqSet) { + if (gt2 && !satisfies3(eq, String(gt2), options)) { + return null; + } + if (lt && !satisfies3(eq, String(lt), options)) { + return null; + } + for (const c of dom) { + if (!satisfies3(eq, String(c), options)) { + return false; + } + } + return true; } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; + hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; + if (gt2) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; } } - return id; - }); + if (c.operator === ">" || c.operator === ">=") { + higher = higherGT(gt2, c, options); + if (higher === c && higher !== gt2) { + return false; + } + } else if (gt2.operator === ">=" && !satisfies3(gt2.semver, String(c), options)) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c.operator === "<" || c.operator === "<=") { + lower = lowerLT(lt, c, options); + if (lower === c && lower !== lt) { + return false; + } + } else if (lt.operator === "<=" && !satisfies3(lt.semver, String(c), options)) { + return false; + } + } + if (!c.operator && (lt || gt2) && gtltComp !== 0) { + return false; + } } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); + if (gt2 && hasDomLT && !lt && gtltComp !== 0) { + return false; } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug2("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + if (lt && hasDomGT && !gt2 && gtltComp !== 0) { + return false; } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + if (needDomGTPre || needDomLTPre) { + return false; } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + return true; }; - SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; + var higherGT = (a, b, options) => { + if (!a) { + return b; } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug2("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); + const comp = compare(a.semver, b.semver, options); + return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug2("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); - } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } - } - if (i2 === -1) { - this.prerelease.push(0); - } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - default: - throw new Error("invalid increment argument: " + release); + var lowerLT = (a, b, options) => { + if (!a) { + return b; } - this.format(); - this.raw = this.version; - return this; + const comp = compare(a.semver, b.semver, options); + return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; }; - exports2.inc = inc; - function inc(version, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; - } - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse2(version1); - var v2 = parse2(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; - } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } - } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; - } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - } - exports2.rcompareIdentifiers = rcompareIdentifiers; - function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); - } - exports2.major = major; - function major(a, loose) { - return new SemVer(a, loose).major; - } - exports2.minor = minor; - function minor(a, loose) { - return new SemVer(a, loose).minor; - } - exports2.patch = patch; - function patch(a, loose) { - return new SemVer(a, loose).patch; - } - exports2.compare = compare; - function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare(a, b, true); - } - exports2.compareBuild = compareBuild; - function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - } - exports2.rcompare = rcompare; - function rcompare(a, b, loose) { - return compare(b, a, loose); - } - exports2.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(a, b, loose); - }); - } - exports2.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(b, a, loose); - }); - } - exports2.gt = gt; - function gt(a, b, loose) { - return compare(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare(a, b, loose) !== 0; - } - exports2.gte = gte; - function gte(a, b, loose) { - return compare(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare(a, b, loose) <= 0; - } - exports2.cmp = cmp; - function cmp(a, op, b, loose) { - switch (op) { - case "===": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a === b; - case "!==": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); - } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - debug2("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } - debug2("comp", this); - } - var ANY = {}; - Comparator.prototype.parse = function(comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var m = comp.match(r); - if (!m) { - throw new TypeError("Invalid comparator: " + comp); - } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; - } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } + module2.exports = subset; + } +}); + +// node_modules/semver/index.js +var require_semver2 = __commonJS({ + "node_modules/semver/index.js"(exports2, module2) { + "use strict"; + var internalRe = require_re(); + var constants4 = require_constants6(); + var SemVer = require_semver(); + var identifiers = require_identifiers(); + var parse2 = require_parse2(); + var valid2 = require_valid(); + var clean2 = require_clean(); + var inc = require_inc(); + var diff = require_diff(); + var major = require_major(); + var minor = require_minor(); + var patch = require_patch(); + var prerelease = require_prerelease(); + var compare = require_compare(); + var rcompare = require_rcompare(); + var compareLoose = require_compare_loose(); + var compareBuild = require_compare_build(); + var sort = require_sort(); + var rsort = require_rsort(); + var gt2 = require_gt(); + var lt = require_lt(); + var eq = require_eq(); + var neq = require_neq(); + var gte = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce = require_coerce(); + var Comparator = require_comparator(); + var Range = require_range(); + var satisfies3 = require_satisfies(); + var toComparators = require_to_comparators(); + var maxSatisfying = require_max_satisfying(); + var minSatisfying = require_min_satisfying(); + var minVersion = require_min_version(); + var validRange = require_valid2(); + var outside = require_outside(); + var gtr = require_gtr(); + var ltr = require_ltr(); + var intersects = require_intersects(); + var simplifyRange = require_simplify(); + var subset = require_subset(); + module2.exports = { + parse: parse2, + valid: valid2, + clean: clean2, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt: gt2, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies: satisfies3, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants4.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants4.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers }; - Comparator.prototype.toString = function() { - return this.value; + } +}); + +// node_modules/fast-content-type-parse/index.js +var require_fast_content_type_parse = __commonJS({ + "node_modules/fast-content-type-parse/index.js"(exports2, module2) { + "use strict"; + var NullObject = function NullObject2() { }; - Comparator.prototype.test = function(version) { - debug2("Comparator.test", version, this.options.loose); - if (this.semver === ANY || version === ANY) { - return true; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } + NullObject.prototype = /* @__PURE__ */ Object.create(null); + var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu; + var quotedPairRE = /\\([\v\u0020-\u00ff])/gu; + var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u; + var defaultContentType = { type: "", parameters: new NullObject() }; + Object.freeze(defaultContentType.parameters); + Object.freeze(defaultContentType); + function parse2(header) { + if (typeof header !== "string") { + throw new TypeError("argument header is required and must be a string"); } - return cmp(version, this.operator, this.semver, this.options); - }; - Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); + let index = header.indexOf(";"); + const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); + if (mediaTypeRE.test(type) === false) { + throw new TypeError("invalid media type"); } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + const result = { + type: type.toLowerCase(), + parameters: new NullObject() + }; + if (index === -1) { + return result; } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + let key; + let match; + let value; + paramRE.lastIndex = index; + while (match = paramRE.exec(header)) { + if (match.index !== index) { + throw new TypeError("invalid parameter format"); } - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value[0] === '"') { + value = value.slice(1, value.length - 1); + quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); } - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); - } - var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); - var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); - var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); - var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; - }; - exports2.Range = Range; - function Range(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + result.parameters[key] = value; } - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); - } + if (index !== header.length) { + throw new TypeError("invalid parameter format"); } - if (range instanceof Comparator) { - return new Range(range.value, options); + return result; + } + function safeParse2(header) { + if (typeof header !== "string") { + return defaultContentType; } - if (!(this instanceof Range)) { - return new Range(range, options); + let index = header.indexOf(";"); + const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); + if (mediaTypeRE.test(type) === false) { + return defaultContentType; } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + range); - } - this.format(); - } - Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(" ").trim(); - }).join("||").trim(); - return this.range; - }; - Range.prototype.toString = function() { - return this.range; - }; - Range.prototype.parseRange = function(range) { - var loose = this.options.loose; - range = range.trim(); - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug2("hyphen replace", range); - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug2("comparator trim", range, re[t.COMPARATORTRIM]); - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); - range = range.replace(re[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var set = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); + const result = { + type: type.toLowerCase(), + parameters: new NullObject() + }; + if (index === -1) { + return result; } - set = set.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set; - }; - Range.prototype.intersects = function(range, options) { - if (!(range instanceof Range)) { - throw new TypeError("a Range is required"); + let key; + let match; + let value; + paramRE.lastIndex = index; + while (match = paramRE.exec(header)) { + if (match.index !== index) { + return defaultContentType; + } + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value[0] === '"') { + value = value.slice(1, value.length - 1); + quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); + } + result.parameters[key] = value; } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - }; - function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every(function(otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); + if (index !== header.length) { + return defaultContentType; } return result; } - exports2.toComparators = toComparators; - function toComparators(range, options) { - return new Range(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug2("comp", comp, options); - comp = replaceCarets(comp, options); - debug2("caret", comp); - comp = replaceTildes(comp, options); - debug2("tildes", comp); - comp = replaceXRanges(comp, options); - debug2("xrange", comp); - comp = replaceStars(comp, options); - debug2("stars", comp); - return comp; - } - function isX(id) { - return !id || id.toLowerCase() === "x" || id === "*"; - } - function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); - } - function replaceTilde(comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug2("tilde", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else if (pr) { - debug2("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - debug2("tilde return", ret); - return ret; - }); - } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug2("caret", comp, options); - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug2("caret", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - if (M === "0") { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; + module2.exports.default = { parse: parse2, safeParse: safeParse2 }; + module2.exports.parse = parse2; + module2.exports.safeParse = safeParse2; + module2.exports.defaultContentType = defaultContentType; + } +}); + +// node_modules/bottleneck/light.js +var require_light = __commonJS({ + "node_modules/bottleneck/light.js"(exports2, module2) { + (function(global2, factory) { + typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.Bottleneck = factory(); + })(exports2, (function() { + "use strict"; + var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; + function getCjsExportFromNamespace(n) { + return n && n["default"] || n; + } + var load = function(received, defaults, onto = {}) { + var k, ref, v; + for (k in defaults) { + v = defaults[k]; + onto[k] = (ref = received[k]) != null ? ref : v; + } + return onto; + }; + var overwrite = function(received, defaults, onto = {}) { + var k, v; + for (k in received) { + v = received[k]; + if (defaults[k] !== void 0) { + onto[k] = v; } - } else if (pr) { - debug2("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; + } + return onto; + }; + var parser = { + load, + overwrite + }; + var DLList; + DLList = class DLList { + constructor(incr, decr) { + this.incr = incr; + this.decr = decr; + this._first = null; + this._last = null; + this.length = 0; + } + push(value) { + var node; + this.length++; + if (typeof this.incr === "function") { + this.incr(); } - } else { - debug2("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } + node = { + value, + prev: this._last, + next: null + }; + if (this._last != null) { + this._last.next = node; + this._last = node; } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; + this._first = this._last = node; } + return void 0; } - debug2("caret return", ret); - return ret; - }); - } - function replaceXRanges(comp, options) { - debug2("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); - } - function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug2("xRange", comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; + shift() { + var value; + if (this._first == null) { + return; } else { - ret = "*"; + this.length--; + if (typeof this.decr === "function") { + this.decr(); + } } - } else if (gtlt && anyX) { - if (xm) { - m = 0; + value = this._first.value; + if ((this._first = this._first.next) != null) { + this._first.prev = null; + } else { + this._last = null; } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } + return value; + } + first() { + if (this._first != null) { + return this._first.value; } - ret = gtlt + M + "." + m + "." + p + pr; - } else if (xm) { - ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr; - } else if (xp) { - ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; } - debug2("xRange return", ret); - return ret; - }); - } - function replaceStars(comp, options) { - debug2("replaceStars", comp, options); - return comp.trim().replace(re[t.STAR], ""); - } - function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = ">=" + fM + ".0.0"; - } else if (isX(fp)) { - from = ">=" + fM + "." + fm + ".0"; - } else { - from = ">=" + from; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = "<" + (+tM + 1) + ".0.0"; - } else if (isX(tp)) { - to = "<" + tM + "." + (+tm + 1) + ".0"; - } else if (tpr) { - to = "<=" + tM + "." + tm + "." + tp + "-" + tpr; - } else { - to = "<=" + to; - } - return (from + " " + to).trim(); - } - Range.prototype.test = function(version) { - if (!version) { - return false; - } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + getArray() { + var node, ref, results; + node = this._first; + results = []; + while (node != null) { + results.push((ref = node, node = node.next, ref.value)); + } + return results; } - } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; + forEachShift(cb) { + var node; + node = this.shift(); + while (node != null) { + cb(node), node = this.shift(); + } + return void 0; } - } - return false; - }; - function testSet(set, version, options) { - for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version)) { - return false; + debug() { + var node, ref, ref1, ref2, results; + node = this._first; + results = []; + while (node != null) { + results.push((ref = node, node = node.next, { + value: ref.value, + prev: (ref1 = ref.prev) != null ? ref1.value : void 0, + next: (ref2 = ref.next) != null ? ref2.value : void 0 + })); + } + return results; } - } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set.length; i2++) { - debug2(set[i2].semver); - if (set[i2].semver === ANY) { - continue; + }; + var DLList_1 = DLList; + var Events; + Events = class Events { + constructor(instance) { + this.instance = instance; + this._events = {}; + if (this.instance.on != null || this.instance.once != null || this.instance.removeAllListeners != null) { + throw new Error("An Emitter already exists for this object"); } - if (set[i2].semver.prerelease.length > 0) { - var allowed = set[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; + this.instance.on = (name, cb) => { + return this._addListener(name, "many", cb); + }; + this.instance.once = (name, cb) => { + return this._addListener(name, "once", cb); + }; + this.instance.removeAllListeners = (name = null) => { + if (name != null) { + return delete this._events[name]; + } else { + return this._events = {}; } - } + }; } - return false; - } - return true; - } - exports2.satisfies = satisfies; - function satisfies(version, range, options) { - try { - range = new Range(range, options); - } catch (er) { - return false; - } - return range.test(version); - } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); + _addListener(name, status, cb) { + var base; + if ((base = this._events)[name] == null) { + base[name] = []; } + this._events[name].push({ cb, status }); + return this.instance; } - }); - return max; - } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); + listenerCount(name) { + if (this._events[name] != null) { + return this._events[name].length; + } else { + return 0; } } - }); - return min; - } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - comparators.forEach(function(comparator) { - var compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); + async trigger(name, ...args) { + var e, promises4; + try { + if (name !== "debug") { + this.trigger("debug", `Event triggered: ${name}`, args); + } + if (this._events[name] == null) { + return; + } + this._events[name] = this._events[name].filter(function(listener) { + return listener.status !== "none"; + }); + promises4 = this._events[name].map(async (listener) => { + var e2, returned; + if (listener.status === "none") { + return; } - compver.raw = compver.format(); - /* fallthrough */ - case "": - case ">=": - if (!minver || gt(minver, compver)) { - minver = compver; + if (listener.status === "once") { + listener.status = "none"; } - break; - case "<": - case "<=": - break; - /* istanbul ignore next */ - default: - throw new Error("Unexpected operation: " + comparator.operator); - } - }); - } - if (minver && range.test(minver)) { - return minver; - } - return null; - } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range(range, options).range || "*"; - } catch (er) { - return null; - } - } - exports2.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); - } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies(version, range, options)) { - return false; - } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse2(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - } - exports2.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); - } - exports2.coerce = coerce; - function coerce(version, options) { - if (version instanceof SemVer) { - return version; - } - if (typeof version === "number") { - version = String(version); - } - if (typeof version !== "string") { - return null; - } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(re[t.COERCE]); - } else { - var next; - while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - re[t.COERCERTL].lastIndex = -1; - } - if (match === null) { - return null; - } - return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); - } - } -}); - -// node_modules/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver = __importStar(require_semver()); - var core_1 = require_core(); - var os5 = require("os"); - var cp = require("child_process"); - var fs4 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter2(this, void 0, void 0, function* () { - const platFilter = os5.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) { - file = candidate.files.find((item) => { - (0, core_1.debug)(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); - let chk = item.arch === archFilter && item.platform === platFilter; - if (chk && item.platform_version) { - const osVersion = module2.exports._getOsVersion(); - if (osVersion === item.platform_version) { - chk = true; + try { + returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; + if (typeof (returned != null ? returned.then : void 0) === "function") { + return await returned; } else { - chk = semver.satisfies(osVersion, item.platform_version); + return returned; + } + } catch (error3) { + e2 = error3; + { + this.trigger("error", e2); } + return null; } - return chk; }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; + return (await Promise.all(promises4)).find(function(x) { + return x != null; + }); + } catch (error3) { + e = error3; + { + this.trigger("error", e); } + return null; } } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os5.platform(); - let version = ""; - if (plat === "darwin") { - version = cp.execSync("sw_vers -productVersion").toString(); - } else if (plat === "linux") { - const lsbContents = module2.exports._readLinuxVersionFile(); - if (lsbContents) { - const lines = lsbContents.split("\n"); - for (const line of lines) { - const parts = line.split("="); - if (parts.length === 2 && (parts[0].trim() === "VERSION_ID" || parts[0].trim() === "DISTRIB_RELEASE")) { - version = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); - break; + }; + var Events_1 = Events; + var DLList$1, Events$1, Queues; + DLList$1 = DLList_1; + Events$1 = Events_1; + Queues = class Queues { + constructor(num_priorities) { + var i; + this.Events = new Events$1(this); + this._length = 0; + this._lists = (function() { + var j, ref, results; + results = []; + for (i = j = 1, ref = num_priorities; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { + results.push(new DLList$1((() => { + return this.incr(); + }), (() => { + return this.decr(); + }))); } - } + return results; + }).call(this); } - } - return version; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs4.existsSync(lsbReleaseFile)) { - contents = fs4.readFileSync(lsbReleaseFile).toString(); - } else if (fs4.existsSync(osReleaseFile)) { - contents = fs4.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + incr() { + if (this._length++ === 0) { + return this.Events.trigger("leftzero"); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + decr() { + if (--this._length === 0) { + return this.Events.trigger("zero"); } } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + push(job) { + return this._lists[job.options.priority].push(job); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core = __importStar(require_core()); - var RetryHelper = class { - constructor(maxAttempts, minSeconds, maxSeconds) { - if (maxAttempts < 1) { - throw new Error("max attempts should be greater than or equal to 1"); - } - this.maxAttempts = maxAttempts; - this.minSeconds = Math.floor(minSeconds); - this.maxSeconds = Math.floor(maxSeconds); - if (this.minSeconds > this.maxSeconds) { - throw new Error("min seconds should be less than or equal to max seconds"); - } - } - execute(action, isRetryable) { - return __awaiter2(this, void 0, void 0, function* () { - let attempt = 1; - while (attempt < this.maxAttempts) { - try { - return yield action(); - } catch (err) { - if (isRetryable && !isRetryable(err)) { - throw err; - } - core.info(err.message); - } - const seconds = this.getSleepAmount(); - core.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + queued(priority) { + if (priority != null) { + return this._lists[priority].length; + } else { + return this._length; } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter2(this, void 0, void 0, function* () { - return new Promise((resolve) => setTimeout(resolve, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; - } -}); - -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + } + shiftAll(fn) { + return this._lists.forEach(function(list) { + return list.forEachShift(fn); + }); + } + getFirst(arr = this._lists) { + var j, len, list; + for (j = 0, len = arr.length; j < len; j++) { + list = arr[j]; + if (list.length > 0) { + return list; + } } + return []; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + shiftLastFrom(priority) { + return this.getFirst(this._lists.slice(priority).reverse()).shift(); + } + }; + var Queues_1 = Queues; + var BottleneckError; + BottleneckError = class BottleneckError extends Error { + }; + var BottleneckError_1 = BottleneckError; + var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; + NUM_PRIORITIES = 10; + DEFAULT_PRIORITY = 5; + parser$1 = parser; + BottleneckError$1 = BottleneckError_1; + Job = class Job { + constructor(task, args, options, jobDefaults, rejectOnDrop, Events2, _states, Promise2) { + this.task = task; + this.args = args; + this.rejectOnDrop = rejectOnDrop; + this.Events = Events2; + this._states = _states; + this.Promise = Promise2; + this.options = parser$1.load(options, jobDefaults); + this.options.priority = this._sanitizePriority(this.options.priority); + if (this.options.id === jobDefaults.id) { + this.options.id = `${this.options.id}-${this._randomIndex()}`; + } + this.promise = new this.Promise((_resolve, _reject) => { + this._resolve = _resolve; + this._reject = _reject; + }); + this.retryCount = 0; + } + _sanitizePriority(priority) { + var sProperty; + sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority; + if (sProperty < 0) { + return 0; + } else if (sProperty > NUM_PRIORITIES - 1) { + return NUM_PRIORITIES - 1; + } else { + return sProperty; } } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + _randomIndex() { + return Math.random().toString(36).slice(2); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core = __importStar(require_core()); - var io = __importStar(require_io()); - var crypto = __importStar(require("crypto")); - var fs4 = __importStar(require("fs")); - var mm = __importStar(require_manifest()); - var os5 = __importStar(require("os")); - var path3 = __importStar(require("path")); - var httpm = __importStar(require_lib()); - var semver = __importStar(require_semver()); - var stream = __importStar(require("stream")); - var util = __importStar(require("util")); - var assert_1 = require("assert"); - var exec_1 = require_exec(); - var retry_helper_1 = require_retry_helper(); - var HTTPError = class extends Error { - constructor(httpStatusCode) { - super(`Unexpected HTTP response: ${httpStatusCode}`); - this.httpStatusCode = httpStatusCode; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports2.HTTPError = HTTPError; - var IS_WINDOWS3 = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent2 = "actions/tool-cache"; - function downloadTool2(url, dest, auth2, headers) { - return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path3.join(_getTempDirectory(), crypto.randomUUID()); - yield io.mkdirP(path3.dirname(dest)); - core.debug(`Downloading ${url}`); - core.debug(`Destination ${dest}`); - const maxAttempts = 3; - const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); - const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); - const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds); - return yield retryHelper.execute(() => __awaiter2(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth2, headers); - }), (err) => { - if (err instanceof HTTPError && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { + if (this._states.remove(this.options.id)) { + if (this.rejectOnDrop) { + this._reject(error3 != null ? error3 : new BottleneckError$1(message)); } + this.Events.trigger("dropped", { args: this.args, options: this.options, task: this.task, promise: this.promise }); + return true; + } else { + return false; } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth2, headers) { - return __awaiter2(this, void 0, void 0, function* () { - if (fs4.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); } - const http = new httpm.HttpClient(userAgent2, [], { - allowRetries: false - }); - if (auth2) { - core.debug("set auth"); - if (headers === void 0) { - headers = {}; + _assertStatus(expected) { + var status; + status = this._states.jobStatus(this.options.id); + if (!(status === expected || expected === "DONE" && status === null)) { + throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); } - headers.authorization = auth2; } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError(response.message.statusCode); - core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; + doReceive() { + this._states.start(this.options.id); + return this.Events.trigger("received", { args: this.args, options: this.options }); } - 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, fs4.createWriteStream(dest)); - core.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core.debug("download failed"); - try { - yield io.rmRF(dest); - } catch (err) { - core.debug(`Failed to delete '${dest}'. ${err.message}`); - } + doQueue(reachedHWM, blocked) { + this._assertStatus("RECEIVED"); + this._states.next(this.options.id); + return this.Events.trigger("queued", { args: this.args, options: this.options, reachedHWM, blocked }); + } + doRun() { + if (this.retryCount === 0) { + this._assertStatus("QUEUED"); + this._states.next(this.options.id); + } else { + this._assertStatus("EXECUTING"); } + return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter2(this, void 0, void 0, function* () { - (0, assert_1.ok)(IS_WINDOWS3, "extract7z() not supported on current OS"); - (0, assert_1.ok)(file, 'parameter "file" is required'); - dest = yield _createExtractFolder(dest); - const originalCwd = process.cwd(); - process.chdir(dest); - if (_7zPath) { - try { - const logLevel = core.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); + async doExecute(chained, clearGlobalState, run, free) { + var error3, eventInfo, passed; + if (this.retryCount === 0) { + this._assertStatus("RUNNING"); + this._states.next(this.options.id); + } else { + this._assertStatus("EXECUTING"); } - } else { - const escapedScript = path3.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}'`; - const args = [ - "-NoLogo", - "-Sta", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - command - ]; - const options = { - silent: true - }; + eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; + this.Events.trigger("executing", eventInfo); try { - const powershellPath = yield io.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); + passed = await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args)); + if (clearGlobalState()) { + this.doDone(eventInfo); + await free(this.options, eventInfo); + this._assertStatus("DONE"); + return this._resolve(passed); + } + } catch (error1) { + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar(file, dest, flags = "xz") { - return __awaiter2(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core.debug("Checking tar --version"); - let versionOutput = ""; - yield (0, exec_1.exec)("tar --version", [], { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + doExpire(clearGlobalState, run, free) { + var error3, eventInfo; + if (this._states.jobStatus(this.options.id === "RUNNING")) { + this._states.next(this.options.id); } - }); - core.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; + this._assertStatus("EXECUTING"); + eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } - if (core.isDebug() && !flags.includes("v")) { - args.push("-v"); + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { + var retry2, retryAfter; + if (clearGlobalState()) { + retry2 = await this.Events.trigger("failed", error3, eventInfo); + if (retry2 != null) { + retryAfter = ~~retry2; + this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); + this.retryCount++; + return run(retryAfter); + } else { + this.doDone(eventInfo); + await free(this.options, eventInfo); + this._assertStatus("DONE"); + return this._reject(error3); + } + } } - let destArg = dest; - let fileArg = file; - if (IS_WINDOWS3 && isGnuTar) { - args.push("--force-local"); - destArg = dest.replace(/\\/g, "/"); - fileArg = file.replace(/\\/g, "/"); + doDone(eventInfo) { + this._assertStatus("EXECUTING"); + this._states.next(this.options.id); + return this.Events.trigger("done", eventInfo); } - if (isGnuTar) { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); + }; + var Job_1 = Job; + var BottleneckError$2, LocalDatastore, parser$2; + parser$2 = parser; + BottleneckError$2 = BottleneckError_1; + LocalDatastore = class LocalDatastore { + constructor(instance, storeOptions, storeInstanceOptions) { + this.instance = instance; + this.storeOptions = storeOptions; + this.clientId = this.instance._randomIndex(); + parser$2.load(storeInstanceOptions, storeInstanceOptions, this); + this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); + this._running = 0; + this._done = 0; + this._unblockTime = 0; + this.ready = this.Promise.resolve(); + this.clients = {}; + this._startHeartbeat(); } - args.push("-C", destArg, "-f", fileArg); - yield (0, exec_1.exec)(`tar`, args); - return dest; - }); - } - exports2.extractTar = extractTar; - function extractXar(file, dest, flags = []) { - return __awaiter2(this, void 0, void 0, function* () { - (0, assert_1.ok)(IS_MAC, "extractXar() not supported on current OS"); - (0, assert_1.ok)(file, 'parameter "file" is required'); - dest = yield _createExtractFolder(dest); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; + _startHeartbeat() { + var base; + if (this.heartbeat == null && (this.storeOptions.reservoirRefreshInterval != null && this.storeOptions.reservoirRefreshAmount != null || this.storeOptions.reservoirIncreaseInterval != null && this.storeOptions.reservoirIncreaseAmount != null)) { + return typeof (base = this.heartbeat = setInterval(() => { + var amount, incr, maximum, now, reservoir; + now = Date.now(); + if (this.storeOptions.reservoirRefreshInterval != null && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { + this._lastReservoirRefresh = now; + this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; + this.instance._drainAll(this.computeCapacity()); + } + if (this.storeOptions.reservoirIncreaseInterval != null && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { + ({ + reservoirIncreaseAmount: amount, + reservoirIncreaseMaximum: maximum, + reservoir + } = this.storeOptions); + this._lastReservoirIncrease = now; + incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; + if (incr > 0) { + this.storeOptions.reservoir += incr; + return this.instance._drainAll(this.computeCapacity()); + } + } + }, this.heartbeatInterval)).unref === "function" ? base.unref() : void 0; + } else { + return clearInterval(this.heartbeat); + } } - args.push("-x", "-C", dest, "-f", file); - if (core.isDebug()) { - args.push("-v"); + async __publish__(message) { + await this.yieldLoop(); + return this.instance.Events.trigger("message", message.toString()); } - const xarPath = yield io.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); + async __disconnect__(flush) { + await this.yieldLoop(); + clearInterval(this.heartbeat); + return this.Promise.resolve(); } - dest = yield _createExtractFolder(dest); - if (IS_WINDOWS3) { - yield extractZipWin(file, dest); - } else { - yield extractZipNix(file, dest); + yieldLoop(t = 0) { + return new this.Promise(function(resolve, reject) { + return setTimeout(resolve, t); + }); } - return dest; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const pwshPath = yield io.which("pwsh", false); - if (pwshPath) { - const pwshCommand = [ - `$ErrorActionPreference = 'Stop' ;`, - `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`, - `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`, - `catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;` - ].join(" "); - const args = [ - "-NoLogo", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - pwshCommand - ]; - core.debug(`Using pwsh at path: ${pwshPath}`); - yield (0, exec_1.exec)(`"${pwshPath}"`, args); - } else { - const powershellCommand = [ - `$ErrorActionPreference = 'Stop' ;`, - `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`, - `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`, - `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }` - ].join(" "); - const args = [ - "-NoLogo", - "-Sta", - "-NoProfile", - "-NonInteractive", - "-ExecutionPolicy", - "Unrestricted", - "-Command", - powershellCommand - ]; - const powershellPath = yield io.which("powershell", true); - core.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); + computePenalty() { + var ref; + return (ref = this.storeOptions.penalty) != null ? ref : 15 * this.storeOptions.minTime || 5e3; } - }); - } - function extractZipNix(file, dest) { - return __awaiter2(this, void 0, void 0, function* () { - const unzipPath = yield io.which("unzip", true); - const args = [file]; - if (!core.isDebug()) { - args.unshift("-q"); + async __updateSettings__(options) { + await this.yieldLoop(); + parser$2.overwrite(options, options, this.storeOptions); + this._startHeartbeat(); + this.instance._drainAll(this.computeCapacity()); + return true; } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch3) { - return __awaiter2(this, void 0, void 0, function* () { - version = semver.clean(version) || version; - arch3 = arch3 || os5.arch(); - core.debug(`Caching tool ${tool} ${version} ${arch3}`); - core.debug(`source dir: ${sourceDir}`); - if (!fs4.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch3); - for (const itemName of fs4.readdirSync(sourceDir)) { - const s = path3.join(sourceDir, itemName); - yield io.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch3); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch3) { - return __awaiter2(this, void 0, void 0, function* () { - version = semver.clean(version) || version; - arch3 = arch3 || os5.arch(); - core.debug(`Caching tool ${tool} ${version} ${arch3}`); - core.debug(`source file: ${sourceFile}`); - if (!fs4.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch3); - const destPath = path3.join(destFolder, targetFile); - core.debug(`destination file ${destPath}`); - yield io.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch3); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find(toolName, versionSpec, arch3) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch3 = arch3 || os5.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions(toolName, arch3); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver.clean(versionSpec) || ""; - const cachePath = path3.join(_getCacheDirectory(), toolName, versionSpec, arch3); - core.debug(`checking cache: ${cachePath}`); - if (fs4.existsSync(cachePath) && fs4.existsSync(`${cachePath}.complete`)) { - core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch3}`); - toolPath = cachePath; - } else { - core.debug("not found"); - } - } - return toolPath; - } - exports2.find = find; - function findAllVersions(toolName, arch3) { - const versions = []; - arch3 = arch3 || os5.arch(); - const toolPath = path3.join(_getCacheDirectory(), toolName); - if (fs4.existsSync(toolPath)) { - const children = fs4.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path3.join(toolPath, child, arch3 || ""); - if (fs4.existsSync(fullPath) && fs4.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } + async __running__() { + await this.yieldLoop(); + return this._running; } - } - return versions; - } - exports2.findAllVersions = findAllVersions; - function getManifestFromRepo(owner, repo, auth2, branch = "master") { - return __awaiter2(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth2) { - core.debug("set auth"); - headers.authorization = auth2; - } - const response = yield http.getJson(treeUrl, headers); - if (!response.result) { - return releases; - } - let manifestUrl = ""; - for (const item of response.result.tree) { - if (item.path === "versions-manifest.json") { - manifestUrl = item.url; - break; - } + async __queued__() { + await this.yieldLoop(); + return this.instance.queued(); } - headers["accept"] = "application/vnd.github.VERSION.raw"; - let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); - if (versionsRaw) { - versionsRaw = versionsRaw.replace(/^\uFEFF/, ""); - try { - releases = JSON.parse(versionsRaw); - } catch (_a) { - core.debug("Invalid json"); - } + async __done__() { + await this.yieldLoop(); + return this._done; } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os5.arch()) { - return __awaiter2(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter2(this, void 0, void 0, function* () { - if (!dest) { - dest = path3.join(_getTempDirectory(), crypto.randomUUID()); + async __groupCheck__(time) { + await this.yieldLoop(); + return this._nextRequest + this.timeout < time; } - yield io.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch3) { - return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path3.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch3 || ""); - core.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io.rmRF(folderPath); - yield io.rmRF(markerPath); - yield io.mkdirP(folderPath); - return folderPath; - }); - } - function _completeToolPath(tool, version, arch3) { - const folderPath = path3.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch3 || ""); - const markerPath = `${folderPath}.complete`; - fs4.writeFileSync(markerPath, ""); - core.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver.clean(versionSpec) || ""; - core.debug(`isExplicit: ${c}`); - const valid = semver.valid(c) != null; - core.debug(`explicit? ${valid}`); - return valid; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver.gt(a, b)) { - return 1; + computeCapacity() { + var maxConcurrent, reservoir; + ({ maxConcurrent, reservoir } = this.storeOptions); + if (maxConcurrent != null && reservoir != null) { + return Math.min(maxConcurrent - this._running, reservoir); + } else if (maxConcurrent != null) { + return maxConcurrent - this._running; + } else if (reservoir != null) { + return reservoir; + } else { + return null; + } } - return -1; - }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; + conditionsCheck(weight) { + var capacity; + capacity = this.computeCapacity(); + return capacity == null || weight <= capacity; } - } - if (version) { - core.debug(`matched: ${version}`); - } else { - core.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - function _getCacheDirectory() { - const cacheDirectory = process.env["RUNNER_TOOL_CACHE"] || ""; - (0, assert_1.ok)(cacheDirectory, "Expected RUNNER_TOOL_CACHE to be defined"); - return cacheDirectory; - } - function _getTempDirectory() { - const tempDirectory = process.env["RUNNER_TEMP"] || ""; - (0, assert_1.ok)(tempDirectory, "Expected RUNNER_TEMP to be defined"); - return tempDirectory; - } - function _getGlobal(key, defaultValue) { - const value = global[key]; - return value !== void 0 ? value : defaultValue; - } - function _unique(values) { - return Array.from(new Set(values)); - } - } -}); - -// node_modules/fast-content-type-parse/index.js -var require_fast_content_type_parse = __commonJS({ - "node_modules/fast-content-type-parse/index.js"(exports2, module2) { - "use strict"; - var NullObject = function NullObject2() { - }; - NullObject.prototype = /* @__PURE__ */ Object.create(null); - var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu; - var quotedPairRE = /\\([\v\u0020-\u00ff])/gu; - var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u; - var defaultContentType = { type: "", parameters: new NullObject() }; - Object.freeze(defaultContentType.parameters); - Object.freeze(defaultContentType); - function parse2(header) { - if (typeof header !== "string") { - throw new TypeError("argument header is required and must be a string"); - } - let index = header.indexOf(";"); - const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); - if (mediaTypeRE.test(type) === false) { - throw new TypeError("invalid media type"); - } - const result = { - type: type.toLowerCase(), - parameters: new NullObject() - }; - if (index === -1) { - return result; - } - let key; - let match; - let value; - paramRE.lastIndex = index; - while (match = paramRE.exec(header)) { - if (match.index !== index) { - throw new TypeError("invalid parameter format"); + async __incrementReservoir__(incr) { + var reservoir; + await this.yieldLoop(); + reservoir = this.storeOptions.reservoir += incr; + this.instance._drainAll(this.computeCapacity()); + return reservoir; } - index += match[0].length; - key = match[1].toLowerCase(); - value = match[2]; - if (value[0] === '"') { - value = value.slice(1, value.length - 1); - quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); + async __currentReservoir__() { + await this.yieldLoop(); + return this.storeOptions.reservoir; } - result.parameters[key] = value; - } - if (index !== header.length) { - throw new TypeError("invalid parameter format"); - } - return result; - } - function safeParse2(header) { - if (typeof header !== "string") { - return defaultContentType; - } - let index = header.indexOf(";"); - const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); - if (mediaTypeRE.test(type) === false) { - return defaultContentType; - } - const result = { - type: type.toLowerCase(), - parameters: new NullObject() - }; - if (index === -1) { - return result; - } - let key; - let match; - let value; - paramRE.lastIndex = index; - while (match = paramRE.exec(header)) { - if (match.index !== index) { - return defaultContentType; + isBlocked(now) { + return this._unblockTime >= now; } - index += match[0].length; - key = match[1].toLowerCase(); - value = match[2]; - if (value[0] === '"') { - value = value.slice(1, value.length - 1); - quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); + check(weight, now) { + return this.conditionsCheck(weight) && this._nextRequest - now <= 0; } - result.parameters[key] = value; - } - if (index !== header.length) { - return defaultContentType; - } - return result; - } - module2.exports.default = { parse: parse2, safeParse: safeParse2 }; - module2.exports.parse = parse2; - module2.exports.safeParse = safeParse2; - module2.exports.defaultContentType = defaultContentType; - } -}); - -// node_modules/bottleneck/light.js -var require_light = __commonJS({ - "node_modules/bottleneck/light.js"(exports2, module2) { - (function(global2, factory) { - typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.Bottleneck = factory(); - })(exports2, (function() { - "use strict"; - var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; - function getCjsExportFromNamespace(n) { - return n && n["default"] || n; - } - var load = function(received, defaults, onto = {}) { - var k, ref, v; - for (k in defaults) { - v = defaults[k]; - onto[k] = (ref = received[k]) != null ? ref : v; + async __check__(weight) { + var now; + await this.yieldLoop(); + now = Date.now(); + return this.check(weight, now); } - return onto; - }; - var overwrite = function(received, defaults, onto = {}) { - var k, v; - for (k in received) { - v = received[k]; - if (defaults[k] !== void 0) { - onto[k] = v; + async __register__(index, weight, expiration) { + var now, wait; + await this.yieldLoop(); + now = Date.now(); + if (this.conditionsCheck(weight)) { + this._running += weight; + if (this.storeOptions.reservoir != null) { + this.storeOptions.reservoir -= weight; + } + wait = Math.max(this._nextRequest - now, 0); + this._nextRequest = now + wait + this.storeOptions.minTime; + return { + success: true, + wait, + reservoir: this.storeOptions.reservoir + }; + } else { + return { + success: false + }; } } - return onto; - }; - var parser = { - load, - overwrite - }; - var DLList; - DLList = class DLList { - constructor(incr, decr) { - this.incr = incr; - this.decr = decr; - this._first = null; - this._last = null; - this.length = 0; + strategyIsBlock() { + return this.storeOptions.strategy === 3; } - push(value) { - var node; - this.length++; - if (typeof this.incr === "function") { - this.incr(); - } - node = { - value, - prev: this._last, - next: null - }; - if (this._last != null) { - this._last.next = node; - this._last = node; - } else { - this._first = this._last = node; + async __submit__(queueLength, weight) { + var blocked, now, reachedHWM; + await this.yieldLoop(); + if (this.storeOptions.maxConcurrent != null && weight > this.storeOptions.maxConcurrent) { + throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`); } - return void 0; - } - shift() { - var value; - if (this._first == null) { - return; - } else { - this.length--; - if (typeof this.decr === "function") { - this.decr(); - } - } - value = this._first.value; - if ((this._first = this._first.next) != null) { - this._first.prev = null; - } else { - this._last = null; - } - return value; - } - first() { - if (this._first != null) { - return this._first.value; + now = Date.now(); + reachedHWM = this.storeOptions.highWater != null && queueLength === this.storeOptions.highWater && !this.check(weight, now); + blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); + if (blocked) { + this._unblockTime = now + this.computePenalty(); + this._nextRequest = this._unblockTime + this.storeOptions.minTime; + this.instance._dropAllQueued(); } + return { + reachedHWM, + blocked, + strategy: this.storeOptions.strategy + }; } - getArray() { - var node, ref, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, ref.value)); - } - return results; + async __free__(index, weight) { + await this.yieldLoop(); + this._running -= weight; + this._done += weight; + this.instance._drainAll(this.computeCapacity()); + return { + running: this._running + }; } - forEachShift(cb) { - var node; - node = this.shift(); - while (node != null) { - cb(node), node = this.shift(); - } - return void 0; + }; + var LocalDatastore_1 = LocalDatastore; + var BottleneckError$3, States; + BottleneckError$3 = BottleneckError_1; + States = class States { + constructor(status1) { + this.status = status1; + this._jobs = {}; + this.counts = this.status.map(function() { + return 0; + }); } - debug() { - var node, ref, ref1, ref2, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, { - value: ref.value, - prev: (ref1 = ref.prev) != null ? ref1.value : void 0, - next: (ref2 = ref.next) != null ? ref2.value : void 0 - })); + next(id) { + var current, next; + current = this._jobs[id]; + next = current + 1; + if (current != null && next < this.status.length) { + this.counts[current]--; + this.counts[next]++; + return this._jobs[id]++; + } else if (current != null) { + this.counts[current]--; + return delete this._jobs[id]; } - return results; } - }; - var DLList_1 = DLList; - var Events; - Events = class Events { - constructor(instance) { - this.instance = instance; - this._events = {}; - if (this.instance.on != null || this.instance.once != null || this.instance.removeAllListeners != null) { - throw new Error("An Emitter already exists for this object"); - } - this.instance.on = (name, cb) => { - return this._addListener(name, "many", cb); - }; - this.instance.once = (name, cb) => { - return this._addListener(name, "once", cb); - }; - this.instance.removeAllListeners = (name = null) => { - if (name != null) { - return delete this._events[name]; - } else { - return this._events = {}; - } - }; + start(id) { + var initial; + initial = 0; + this._jobs[id] = initial; + return this.counts[initial]++; } - _addListener(name, status, cb) { - var base; - if ((base = this._events)[name] == null) { - base[name] = []; + remove(id) { + var current; + current = this._jobs[id]; + if (current != null) { + this.counts[current]--; + delete this._jobs[id]; } - this._events[name].push({ cb, status }); - return this.instance; + return current != null; } - listenerCount(name) { - if (this._events[name] != null) { - return this._events[name].length; - } else { - return 0; - } + jobStatus(id) { + var ref; + return (ref = this.status[this._jobs[id]]) != null ? ref : null; } - async trigger(name, ...args) { - var e, promises3; - try { - if (name !== "debug") { - this.trigger("debug", `Event triggered: ${name}`, args); - } - if (this._events[name] == null) { - return; - } - this._events[name] = this._events[name].filter(function(listener) { - return listener.status !== "none"; - }); - promises3 = this._events[name].map(async (listener) => { - var e2, returned; - if (listener.status === "none") { - return; - } - if (listener.status === "once") { - listener.status = "none"; - } - try { - returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; - if (typeof (returned != null ? returned.then : void 0) === "function") { - return await returned; - } else { - return returned; - } - } catch (error3) { - e2 = error3; - { - this.trigger("error", e2); - } - return null; - } - }); - return (await Promise.all(promises3)).find(function(x) { - return x != null; - }); - } catch (error3) { - e = error3; - { - this.trigger("error", e); + statusJobs(status) { + var k, pos, ref, results, v; + if (status != null) { + pos = this.status.indexOf(status); + if (pos < 0) { + throw new BottleneckError$3(`status must be one of ${this.status.join(", ")}`); } - return null; - } - } - }; - var Events_1 = Events; - var DLList$1, Events$1, Queues; - DLList$1 = DLList_1; - Events$1 = Events_1; - Queues = class Queues { - constructor(num_priorities) { - var i; - this.Events = new Events$1(this); - this._length = 0; - this._lists = (function() { - var j, ref, results; + ref = this._jobs; results = []; - for (i = j = 1, ref = num_priorities; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { - results.push(new DLList$1((() => { - return this.incr(); - }), (() => { - return this.decr(); - }))); + for (k in ref) { + v = ref[k]; + if (v === pos) { + results.push(k); + } } return results; - }).call(this); - } - incr() { - if (this._length++ === 0) { - return this.Events.trigger("leftzero"); - } - } - decr() { - if (--this._length === 0) { - return this.Events.trigger("zero"); - } - } - push(job) { - return this._lists[job.options.priority].push(job); - } - queued(priority) { - if (priority != null) { - return this._lists[priority].length; } else { - return this._length; - } - } - shiftAll(fn) { - return this._lists.forEach(function(list) { - return list.forEachShift(fn); - }); - } - getFirst(arr = this._lists) { - var j, len, list; - for (j = 0, len = arr.length; j < len; j++) { - list = arr[j]; - if (list.length > 0) { - return list; - } + return Object.keys(this._jobs); } - return []; } - shiftLastFrom(priority) { - return this.getFirst(this._lists.slice(priority).reverse()).shift(); + statusCounts() { + return this.counts.reduce(((acc, v, i) => { + acc[this.status[i]] = v; + return acc; + }), {}); } }; - var Queues_1 = Queues; - var BottleneckError; - BottleneckError = class BottleneckError extends Error { - }; - var BottleneckError_1 = BottleneckError; - var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; - NUM_PRIORITIES = 10; - DEFAULT_PRIORITY = 5; - parser$1 = parser; - BottleneckError$1 = BottleneckError_1; - Job = class Job { - constructor(task, args, options, jobDefaults, rejectOnDrop, Events2, _states, Promise2) { - this.task = task; - this.args = args; - this.rejectOnDrop = rejectOnDrop; - this.Events = Events2; - this._states = _states; + var States_1 = States; + var DLList$2, Sync; + DLList$2 = DLList_1; + Sync = class Sync { + constructor(name, Promise2) { + this.schedule = this.schedule.bind(this); + this.name = name; this.Promise = Promise2; - this.options = parser$1.load(options, jobDefaults); - this.options.priority = this._sanitizePriority(this.options.priority); - if (this.options.id === jobDefaults.id) { - this.options.id = `${this.options.id}-${this._randomIndex()}`; - } - this.promise = new this.Promise((_resolve, _reject) => { - this._resolve = _resolve; - this._reject = _reject; - }); - this.retryCount = 0; + this._running = 0; + this._queue = new DLList$2(); } - _sanitizePriority(priority) { - var sProperty; - sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority; - if (sProperty < 0) { - return 0; - } else if (sProperty > NUM_PRIORITIES - 1) { - return NUM_PRIORITIES - 1; - } else { - return sProperty; + isEmpty() { + return this._queue.length === 0; + } + async _tryToRun() { + var args, cb, error3, reject, resolve, returned, task; + if (this._running < 1 && this._queue.length > 0) { + this._running++; + ({ task, args, resolve, reject } = this._queue.shift()); + cb = await (async function() { + try { + returned = await task(...args); + return function() { + return resolve(returned); + }; + } catch (error1) { + error3 = error1; + return function() { + return reject(error3); + }; + } + })(); + this._running--; + this._tryToRun(); + return cb(); } } - _randomIndex() { - return Math.random().toString(36).slice(2); + schedule(task, ...args) { + var promise, reject, resolve; + resolve = reject = null; + promise = new this.Promise(function(_resolve, _reject) { + resolve = _resolve; + return reject = _reject; + }); + this._queue.push({ task, args, resolve, reject }); + this._tryToRun(); + return promise; } - doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { - if (this._states.remove(this.options.id)) { - if (this.rejectOnDrop) { - this._reject(error3 != null ? error3 : new BottleneckError$1(message)); + }; + var Sync_1 = Sync; + var version = "2.19.5"; + var version$1 = { + version + }; + var version$2 = /* @__PURE__ */ Object.freeze({ + version, + default: version$1 + }); + var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); + var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); + var require$$4 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); + var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; + parser$3 = parser; + Events$2 = Events_1; + RedisConnection$1 = require$$2; + IORedisConnection$1 = require$$3; + Scripts$1 = require$$4; + Group = (function() { + class Group2 { + constructor(limiterOptions = {}) { + this.deleteKey = this.deleteKey.bind(this); + this.limiterOptions = limiterOptions; + parser$3.load(this.limiterOptions, this.defaults, this); + this.Events = new Events$2(this); + this.instances = {}; + this.Bottleneck = Bottleneck_1; + this._startAutoCleanup(); + this.sharedConnection = this.connection != null; + if (this.connection == null) { + if (this.limiterOptions.datastore === "redis") { + this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); + } else if (this.limiterOptions.datastore === "ioredis") { + this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); + } } - this.Events.trigger("dropped", { args: this.args, options: this.options, task: this.task, promise: this.promise }); - return true; - } else { - return false; - } - } - _assertStatus(expected) { - var status; - status = this._states.jobStatus(this.options.id); - if (!(status === expected || expected === "DONE" && status === null)) { - throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); } - } - doReceive() { - this._states.start(this.options.id); - return this.Events.trigger("received", { args: this.args, options: this.options }); - } - doQueue(reachedHWM, blocked) { - this._assertStatus("RECEIVED"); - this._states.next(this.options.id); - return this.Events.trigger("queued", { args: this.args, options: this.options, reachedHWM, blocked }); - } - doRun() { - if (this.retryCount === 0) { - this._assertStatus("QUEUED"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); + key(key = "") { + var ref; + return (ref = this.instances[key]) != null ? ref : (() => { + var limiter; + limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { + id: `${this.id}-${key}`, + timeout: this.timeout, + connection: this.connection + })); + this.Events.trigger("created", limiter, key); + return limiter; + })(); } - return this.Events.trigger("scheduled", { args: this.args, options: this.options }); - } - async doExecute(chained, clearGlobalState, run, free) { - var error3, eventInfo, passed; - if (this.retryCount === 0) { - this._assertStatus("RUNNING"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); + async deleteKey(key = "") { + var deleted, instance; + instance = this.instances[key]; + if (this.connection) { + deleted = await this.connection.__runCommand__(["del", ...Scripts$1.allKeys(`${this.id}-${key}`)]); + } + if (instance != null) { + delete this.instances[key]; + await instance.disconnect(); + } + return instance != null || deleted > 0; } - eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; - this.Events.trigger("executing", eventInfo); - try { - passed = await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args)); - if (clearGlobalState()) { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._resolve(passed); + limiters() { + var k, ref, results, v; + ref = this.instances; + results = []; + for (k in ref) { + v = ref[k]; + results.push({ + key: k, + limiter: v + }); } - } catch (error1) { - error3 = error1; - return this._onFailure(error3, eventInfo, clearGlobalState, run, free); + return results; } - } - doExpire(clearGlobalState, run, free) { - var error3, eventInfo; - if (this._states.jobStatus(this.options.id === "RUNNING")) { - this._states.next(this.options.id); + keys() { + return Object.keys(this.instances); } - this._assertStatus("EXECUTING"); - eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; - error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error3, eventInfo, clearGlobalState, run, free); - } - async _onFailure(error3, eventInfo, clearGlobalState, run, free) { - var retry2, retryAfter; - if (clearGlobalState()) { - retry2 = await this.Events.trigger("failed", error3, eventInfo); - if (retry2 != null) { - retryAfter = ~~retry2; - this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); - this.retryCount++; - return run(retryAfter); - } else { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._reject(error3); + async clusterKeys() { + var cursor, end, found, i, k, keys, len, next, start; + if (this.connection == null) { + return this.Promise.resolve(this.keys()); + } + keys = []; + cursor = null; + start = `b_${this.id}-`.length; + end = "_settings".length; + while (cursor !== 0) { + [next, found] = await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 1e4]); + cursor = ~~next; + for (i = 0, len = found.length; i < len; i++) { + k = found[i]; + keys.push(k.slice(start, -end)); + } } + return keys; } - } - doDone(eventInfo) { - this._assertStatus("EXECUTING"); - this._states.next(this.options.id); - return this.Events.trigger("done", eventInfo); - } - }; - var Job_1 = Job; - var BottleneckError$2, LocalDatastore, parser$2; - parser$2 = parser; - BottleneckError$2 = BottleneckError_1; - LocalDatastore = class LocalDatastore { - constructor(instance, storeOptions, storeInstanceOptions) { - this.instance = instance; - this.storeOptions = storeOptions; - this.clientId = this.instance._randomIndex(); - parser$2.load(storeInstanceOptions, storeInstanceOptions, this); - this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); - this._running = 0; - this._done = 0; - this._unblockTime = 0; - this.ready = this.Promise.resolve(); - this.clients = {}; - this._startHeartbeat(); - } - _startHeartbeat() { - var base; - if (this.heartbeat == null && (this.storeOptions.reservoirRefreshInterval != null && this.storeOptions.reservoirRefreshAmount != null || this.storeOptions.reservoirIncreaseInterval != null && this.storeOptions.reservoirIncreaseAmount != null)) { - return typeof (base = this.heartbeat = setInterval(() => { - var amount, incr, maximum, now, reservoir; - now = Date.now(); - if (this.storeOptions.reservoirRefreshInterval != null && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { - this._lastReservoirRefresh = now; - this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; - this.instance._drainAll(this.computeCapacity()); - } - if (this.storeOptions.reservoirIncreaseInterval != null && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { - ({ - reservoirIncreaseAmount: amount, - reservoirIncreaseMaximum: maximum, - reservoir - } = this.storeOptions); - this._lastReservoirIncrease = now; - incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; - if (incr > 0) { - this.storeOptions.reservoir += incr; - return this.instance._drainAll(this.computeCapacity()); + _startAutoCleanup() { + var base; + clearInterval(this.interval); + return typeof (base = this.interval = setInterval(async () => { + var e, k, ref, results, time, v; + time = Date.now(); + ref = this.instances; + results = []; + for (k in ref) { + v = ref[k]; + try { + if (await v._store.__groupCheck__(time)) { + results.push(this.deleteKey(k)); + } else { + results.push(void 0); + } + } catch (error3) { + e = error3; + results.push(v.Events.trigger("error", e)); } } - }, this.heartbeatInterval)).unref === "function" ? base.unref() : void 0; - } else { - return clearInterval(this.heartbeat); + return results; + }, this.timeout / 2)).unref === "function" ? base.unref() : void 0; } - } - async __publish__(message) { - await this.yieldLoop(); - return this.instance.Events.trigger("message", message.toString()); - } - async __disconnect__(flush) { - await this.yieldLoop(); - clearInterval(this.heartbeat); - return this.Promise.resolve(); - } - yieldLoop(t = 0) { - return new this.Promise(function(resolve, reject) { - return setTimeout(resolve, t); - }); - } - computePenalty() { - var ref; - return (ref = this.storeOptions.penalty) != null ? ref : 15 * this.storeOptions.minTime || 5e3; - } - async __updateSettings__(options) { - await this.yieldLoop(); - parser$2.overwrite(options, options, this.storeOptions); - this._startHeartbeat(); - this.instance._drainAll(this.computeCapacity()); - return true; - } - async __running__() { - await this.yieldLoop(); - return this._running; - } - async __queued__() { - await this.yieldLoop(); - return this.instance.queued(); - } - async __done__() { - await this.yieldLoop(); - return this._done; - } - async __groupCheck__(time) { - await this.yieldLoop(); - return this._nextRequest + this.timeout < time; - } - computeCapacity() { - var maxConcurrent, reservoir; - ({ maxConcurrent, reservoir } = this.storeOptions); - if (maxConcurrent != null && reservoir != null) { - return Math.min(maxConcurrent - this._running, reservoir); - } else if (maxConcurrent != null) { - return maxConcurrent - this._running; - } else if (reservoir != null) { - return reservoir; - } else { - return null; + updateSettings(options = {}) { + parser$3.overwrite(options, this.defaults, this); + parser$3.overwrite(options, options, this.limiterOptions); + if (options.timeout != null) { + return this._startAutoCleanup(); + } } - } - conditionsCheck(weight) { - var capacity; - capacity = this.computeCapacity(); - return capacity == null || weight <= capacity; - } - async __incrementReservoir__(incr) { - var reservoir; - await this.yieldLoop(); - reservoir = this.storeOptions.reservoir += incr; - this.instance._drainAll(this.computeCapacity()); - return reservoir; - } - async __currentReservoir__() { - await this.yieldLoop(); - return this.storeOptions.reservoir; - } - isBlocked(now) { - return this._unblockTime >= now; - } - check(weight, now) { - return this.conditionsCheck(weight) && this._nextRequest - now <= 0; - } - async __check__(weight) { - var now; - await this.yieldLoop(); - now = Date.now(); - return this.check(weight, now); - } - async __register__(index, weight, expiration) { - var now, wait; - await this.yieldLoop(); - now = Date.now(); - if (this.conditionsCheck(weight)) { - this._running += weight; - if (this.storeOptions.reservoir != null) { - this.storeOptions.reservoir -= weight; + disconnect(flush = true) { + var ref; + if (!this.sharedConnection) { + return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; } - wait = Math.max(this._nextRequest - now, 0); - this._nextRequest = now + wait + this.storeOptions.minTime; - return { - success: true, - wait, - reservoir: this.storeOptions.reservoir - }; - } else { - return { - success: false - }; } } - strategyIsBlock() { - return this.storeOptions.strategy === 3; - } - async __submit__(queueLength, weight) { - var blocked, now, reachedHWM; - await this.yieldLoop(); - if (this.storeOptions.maxConcurrent != null && weight > this.storeOptions.maxConcurrent) { - throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`); + Group2.prototype.defaults = { + timeout: 1e3 * 60 * 5, + connection: null, + Promise, + id: "group-key" + }; + return Group2; + }).call(commonjsGlobal); + var Group_1 = Group; + var Batcher, Events$3, parser$4; + parser$4 = parser; + Events$3 = Events_1; + Batcher = (function() { + class Batcher2 { + constructor(options = {}) { + this.options = options; + parser$4.load(this.options, this.defaults, this); + this.Events = new Events$3(this); + this._arr = []; + this._resetPromise(); + this._lastFlush = Date.now(); } - now = Date.now(); - reachedHWM = this.storeOptions.highWater != null && queueLength === this.storeOptions.highWater && !this.check(weight, now); - blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); - if (blocked) { - this._unblockTime = now + this.computePenalty(); - this._nextRequest = this._unblockTime + this.storeOptions.minTime; - this.instance._dropAllQueued(); + _resetPromise() { + return this._promise = new this.Promise((res, rej) => { + return this._resolve = res; + }); } - return { - reachedHWM, - blocked, - strategy: this.storeOptions.strategy - }; - } - async __free__(index, weight) { - await this.yieldLoop(); - this._running -= weight; - this._done += weight; - this.instance._drainAll(this.computeCapacity()); - return { - running: this._running - }; - } - }; - var LocalDatastore_1 = LocalDatastore; - var BottleneckError$3, States; - BottleneckError$3 = BottleneckError_1; - States = class States { - constructor(status1) { - this.status = status1; - this._jobs = {}; - this.counts = this.status.map(function() { - return 0; - }); - } - next(id) { - var current, next; - current = this._jobs[id]; - next = current + 1; - if (current != null && next < this.status.length) { - this.counts[current]--; - this.counts[next]++; - return this._jobs[id]++; - } else if (current != null) { - this.counts[current]--; - return delete this._jobs[id]; + _flush() { + clearTimeout(this._timeout); + this._lastFlush = Date.now(); + this._resolve(); + this.Events.trigger("batch", this._arr); + this._arr = []; + return this._resetPromise(); } - } - start(id) { - var initial; - initial = 0; - this._jobs[id] = initial; - return this.counts[initial]++; - } - remove(id) { - var current; - current = this._jobs[id]; - if (current != null) { - this.counts[current]--; - delete this._jobs[id]; - } - return current != null; - } - jobStatus(id) { - var ref; - return (ref = this.status[this._jobs[id]]) != null ? ref : null; - } - statusJobs(status) { - var k, pos, ref, results, v; - if (status != null) { - pos = this.status.indexOf(status); - if (pos < 0) { - throw new BottleneckError$3(`status must be one of ${this.status.join(", ")}`); - } - ref = this._jobs; - results = []; - for (k in ref) { - v = ref[k]; - if (v === pos) { - results.push(k); - } + add(data) { + var ret; + this._arr.push(data); + ret = this._promise; + if (this._arr.length === this.maxSize) { + this._flush(); + } else if (this.maxTime != null && this._arr.length === 1) { + this._timeout = setTimeout(() => { + return this._flush(); + }, this.maxTime); } - return results; - } else { - return Object.keys(this._jobs); + return ret; } } - statusCounts() { - return this.counts.reduce(((acc, v, i) => { - acc[this.status[i]] = v; - return acc; - }), {}); - } - }; - var States_1 = States; - var DLList$2, Sync; - DLList$2 = DLList_1; - Sync = class Sync { - constructor(name, Promise2) { - this.schedule = this.schedule.bind(this); - this.name = name; - this.Promise = Promise2; - this._running = 0; - this._queue = new DLList$2(); - } - isEmpty() { - return this._queue.length === 0; - } - async _tryToRun() { - var args, cb, error3, reject, resolve, returned, task; - if (this._running < 1 && this._queue.length > 0) { - this._running++; - ({ task, args, resolve, reject } = this._queue.shift()); - cb = await (async function() { - try { - returned = await task(...args); - return function() { - return resolve(returned); - }; - } catch (error1) { - error3 = error1; - return function() { - return reject(error3); - }; + Batcher2.prototype.defaults = { + maxTime: null, + maxSize: null, + Promise + }; + return Batcher2; + }).call(commonjsGlobal); + var Batcher_1 = Batcher; + var require$$4$1 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); + var require$$8 = getCjsExportFromNamespace(version$2); + var Bottleneck2, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; + NUM_PRIORITIES$1 = 10; + DEFAULT_PRIORITY$1 = 5; + parser$5 = parser; + Queues$1 = Queues_1; + Job$1 = Job_1; + LocalDatastore$1 = LocalDatastore_1; + RedisDatastore$1 = require$$4$1; + Events$4 = Events_1; + States$1 = States_1; + Sync$1 = Sync_1; + Bottleneck2 = (function() { + class Bottleneck3 { + constructor(options = {}, ...invalid) { + var storeInstanceOptions, storeOptions; + this._addToQueue = this._addToQueue.bind(this); + this._validateOptions(options, invalid); + parser$5.load(options, this.instanceDefaults, this); + this._queues = new Queues$1(NUM_PRIORITIES$1); + this._scheduled = {}; + this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); + this._limiter = null; + this.Events = new Events$4(this); + this._submitLock = new Sync$1("submit", this.Promise); + this._registerLock = new Sync$1("register", this.Promise); + storeOptions = parser$5.load(options, this.storeDefaults, {}); + this._store = (function() { + if (this.datastore === "redis" || this.datastore === "ioredis" || this.connection != null) { + storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); + return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); + } else if (this.datastore === "local") { + storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); + return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); + } else { + throw new Bottleneck3.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); } - })(); - this._running--; - this._tryToRun(); - return cb(); + }).call(this); + this._queues.on("leftzero", () => { + var ref; + return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; + }); + this._queues.on("zero", () => { + var ref; + return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; + }); } - } - schedule(task, ...args) { - var promise, reject, resolve; - resolve = reject = null; - promise = new this.Promise(function(_resolve, _reject) { - resolve = _resolve; - return reject = _reject; - }); - this._queue.push({ task, args, resolve, reject }); - this._tryToRun(); - return promise; - } - }; - var Sync_1 = Sync; - var version = "2.19.5"; - var version$1 = { - version - }; - var version$2 = /* @__PURE__ */ Object.freeze({ - version, - default: version$1 - }); - var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$4 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; - parser$3 = parser; - Events$2 = Events_1; - RedisConnection$1 = require$$2; - IORedisConnection$1 = require$$3; - Scripts$1 = require$$4; - Group = (function() { - class Group2 { - constructor(limiterOptions = {}) { - this.deleteKey = this.deleteKey.bind(this); - this.limiterOptions = limiterOptions; - parser$3.load(this.limiterOptions, this.defaults, this); - this.Events = new Events$2(this); - this.instances = {}; - this.Bottleneck = Bottleneck_1; - this._startAutoCleanup(); - this.sharedConnection = this.connection != null; - if (this.connection == null) { - if (this.limiterOptions.datastore === "redis") { - this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); - } else if (this.limiterOptions.datastore === "ioredis") { - this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events })); - } + _validateOptions(options, invalid) { + if (!(options != null && typeof options === "object" && invalid.length === 0)) { + throw new Bottleneck3.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1."); } } - key(key = "") { - var ref; - return (ref = this.instances[key]) != null ? ref : (() => { - var limiter; - limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { - id: `${this.id}-${key}`, - timeout: this.timeout, - connection: this.connection - })); - this.Events.trigger("created", limiter, key); - return limiter; - })(); + ready() { + return this._store.ready; } - async deleteKey(key = "") { - var deleted, instance; - instance = this.instances[key]; - if (this.connection) { - deleted = await this.connection.__runCommand__(["del", ...Scripts$1.allKeys(`${this.id}-${key}`)]); - } - if (instance != null) { - delete this.instances[key]; - await instance.disconnect(); - } - return instance != null || deleted > 0; + clients() { + return this._store.clients; } - limiters() { - var k, ref, results, v; - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - results.push({ - key: k, - limiter: v - }); - } - return results; + channel() { + return `b_${this.id}`; } - keys() { - return Object.keys(this.instances); - } - async clusterKeys() { - var cursor, end, found, i, k, keys, len, next, start; - if (this.connection == null) { - return this.Promise.resolve(this.keys()); - } - keys = []; - cursor = null; - start = `b_${this.id}-`.length; - end = "_settings".length; - while (cursor !== 0) { - [next, found] = await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 1e4]); - cursor = ~~next; - for (i = 0, len = found.length; i < len; i++) { - k = found[i]; - keys.push(k.slice(start, -end)); - } - } - return keys; - } - _startAutoCleanup() { - var base; - clearInterval(this.interval); - return typeof (base = this.interval = setInterval(async () => { - var e, k, ref, results, time, v; - time = Date.now(); - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - try { - if (await v._store.__groupCheck__(time)) { - results.push(this.deleteKey(k)); - } else { - results.push(void 0); - } - } catch (error3) { - e = error3; - results.push(v.Events.trigger("error", e)); - } - } - return results; - }, this.timeout / 2)).unref === "function" ? base.unref() : void 0; - } - updateSettings(options = {}) { - parser$3.overwrite(options, this.defaults, this); - parser$3.overwrite(options, options, this.limiterOptions); - if (options.timeout != null) { - return this._startAutoCleanup(); - } - } - disconnect(flush = true) { - var ref; - if (!this.sharedConnection) { - return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; - } - } - } - Group2.prototype.defaults = { - timeout: 1e3 * 60 * 5, - connection: null, - Promise, - id: "group-key" - }; - return Group2; - }).call(commonjsGlobal); - var Group_1 = Group; - var Batcher, Events$3, parser$4; - parser$4 = parser; - Events$3 = Events_1; - Batcher = (function() { - class Batcher2 { - constructor(options = {}) { - this.options = options; - parser$4.load(this.options, this.defaults, this); - this.Events = new Events$3(this); - this._arr = []; - this._resetPromise(); - this._lastFlush = Date.now(); - } - _resetPromise() { - return this._promise = new this.Promise((res, rej) => { - return this._resolve = res; - }); - } - _flush() { - clearTimeout(this._timeout); - this._lastFlush = Date.now(); - this._resolve(); - this.Events.trigger("batch", this._arr); - this._arr = []; - return this._resetPromise(); - } - add(data) { - var ret; - this._arr.push(data); - ret = this._promise; - if (this._arr.length === this.maxSize) { - this._flush(); - } else if (this.maxTime != null && this._arr.length === 1) { - this._timeout = setTimeout(() => { - return this._flush(); - }, this.maxTime); - } - return ret; - } - } - Batcher2.prototype.defaults = { - maxTime: null, - maxSize: null, - Promise - }; - return Batcher2; - }).call(commonjsGlobal); - var Batcher_1 = Batcher; - var require$$4$1 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); - var require$$8 = getCjsExportFromNamespace(version$2); - var Bottleneck2, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; - NUM_PRIORITIES$1 = 10; - DEFAULT_PRIORITY$1 = 5; - parser$5 = parser; - Queues$1 = Queues_1; - Job$1 = Job_1; - LocalDatastore$1 = LocalDatastore_1; - RedisDatastore$1 = require$$4$1; - Events$4 = Events_1; - States$1 = States_1; - Sync$1 = Sync_1; - Bottleneck2 = (function() { - class Bottleneck3 { - constructor(options = {}, ...invalid) { - var storeInstanceOptions, storeOptions; - this._addToQueue = this._addToQueue.bind(this); - this._validateOptions(options, invalid); - parser$5.load(options, this.instanceDefaults, this); - this._queues = new Queues$1(NUM_PRIORITIES$1); - this._scheduled = {}; - this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); - this._limiter = null; - this.Events = new Events$4(this); - this._submitLock = new Sync$1("submit", this.Promise); - this._registerLock = new Sync$1("register", this.Promise); - storeOptions = parser$5.load(options, this.storeDefaults, {}); - this._store = (function() { - if (this.datastore === "redis" || this.datastore === "ioredis" || this.connection != null) { - storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); - return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); - } else if (this.datastore === "local") { - storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); - return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); - } else { - throw new Bottleneck3.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); - } - }).call(this); - this._queues.on("leftzero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; - }); - this._queues.on("zero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; - }); - } - _validateOptions(options, invalid) { - if (!(options != null && typeof options === "object" && invalid.length === 0)) { - throw new Bottleneck3.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1."); - } - } - ready() { - return this._store.ready; - } - clients() { - return this._store.clients; - } - channel() { - return `b_${this.id}`; - } - channel_client() { - return `b_${this.id}_${this._store.clientId}`; + channel_client() { + return `b_${this.id}_${this._store.clientId}`; } publish(message) { return this._store.__publish__(message); @@ -24692,164 +21926,652 @@ var require_light = __commonJS({ return lib; })); } -}); +}); + +// src/index.ts +var import_node_crypto = require("node:crypto"); +var import_node_os = require("node:os"); +var fs5 = __toESM(require("node:fs")); +var path3 = __toESM(require("node:path")); + +// node_modules/@actions/core/lib/command.js +var os = __toESM(require("os"), 1); + +// node_modules/@actions/core/lib/utils.js +function toCommandValue(input) { + if (input === null || input === void 0) { + return ""; + } else if (typeof input === "string" || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} + +// node_modules/@actions/core/lib/command.js +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +var CMD_STRING = "::"; +var Command = class { + constructor(command, properties, message) { + if (!command) { + command = "missing.command"; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += " "; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } else { + cmdStr += ","; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +}; +function escapeData(s) { + return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +} +function escapeProperty(s) { + return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +} + +// node_modules/@actions/core/lib/file-command.js +var fs = __toESM(require("fs"), 1); +var os2 = __toESM(require("os"), 1); +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 (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${toCommandValue(message)}${os2.EOL}`, { + encoding: "utf8" + }); +} + +// node_modules/@actions/core/lib/core.js +var os4 = __toESM(require("os"), 1); +var path = __toESM(require("path"), 1); + +// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +var tunnel = __toESM(require_tunnel2(), 1); +var import_undici = __toESM(require_undici(), 1); +var HttpCodes; +(function(HttpCodes3) { + HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; + HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; + HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; + HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; + HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; + HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; + HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; + HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; + HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; + HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; + HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (HttpCodes = {})); +var Headers; +(function(Headers3) { + Headers3["Accept"] = "accept"; + Headers3["ContentType"] = "content-type"; +})(Headers || (Headers = {})); +var MediaTypes; +(function(MediaTypes3) { + MediaTypes3["ApplicationJson"] = "application/json"; +})(MediaTypes || (MediaTypes = {})); +var HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +var HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; + +// node_modules/@actions/core/lib/summary.js +var import_os = require("os"); +var import_fs = require("fs"); +var __awaiter = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var { access, appendFile, writeFile } = import_fs.promises; +var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; +var Summary = class { + constructor() { + this._buffer = ""; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, import_fs.constants.R_OK | import_fs.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(import_os.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap("pre", this.wrap("code", code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? "th" : "td"; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag, data, attrs); + }).join(""); + return this.wrap("tr", cells); + }).join(""); + const element = this.wrap("table", tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); + const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap("br", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap("a", text, { href }); + return this.addRaw(element).addEOL(); + } +}; +var _summary = new Summary(); -// src/index.ts -var import_node_crypto = require("node:crypto"); -var import_node_os = require("node:os"); -var fs3 = __toESM(require("node:fs")); -var path2 = __toESM(require("node:path")); +// node_modules/@actions/core/lib/platform.js +var import_os2 = __toESM(require("os"), 1); -// node_modules/@actions/core/lib/command.js -var os = __toESM(require("os"), 1); +// node_modules/@actions/core/node_modules/@actions/io/lib/io-util.js +var fs2 = __toESM(require("fs"), 1); +var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs2.promises; +var IS_WINDOWS = process.platform === "win32"; +var READONLY = fs2.constants.O_RDONLY; -// node_modules/@actions/core/lib/utils.js -function toCommandValue(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; +// node_modules/@actions/core/node_modules/@actions/exec/lib/toolrunner.js +var IS_WINDOWS2 = process.platform === "win32"; + +// node_modules/@actions/core/lib/platform.js +var platform = import_os2.default.platform(); +var arch = import_os2.default.arch(); + +// node_modules/@actions/core/lib/core.js +var ExitCode; +(function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; +})(ExitCode || (ExitCode = {})); +function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + issueFileCommand("PATH", inputPath); + } else { + issueCommand("add-path", {}, inputPath); } - return JSON.stringify(input); + process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`; } -function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - -// node_modules/@actions/core/lib/command.js -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); +function debug(message) { + issueCommand("debug", {}, message); } -var CMD_STRING = "::"; -var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; +function error(message, properties = {}) { + issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +function warning(message, properties = {}) { + issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +function info(message) { + process.stdout.write(message + os4.EOL); +} + +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var import_assert = require("assert"); + +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js +var fs3 = __toESM(require("fs"), 1); +var { chmod: chmod2, copyFile: copyFile2, lstat: lstat2, mkdir: mkdir2, open: open2, readdir: readdir2, rename: rename2, rm: rm2, rmdir: rmdir2, stat: stat2, symlink: symlink2, unlink: unlink2 } = fs3.promises; +var IS_WINDOWS3 = process.platform === "win32"; +var READONLY2 = fs3.constants.O_RDONLY; + +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var __awaiter2 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; -function escapeData(s) { - return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +function rmRF(inputPath) { + return __awaiter2(this, void 0, void 0, function* () { + if (IS_WINDOWS3) { + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + yield rm2(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); } -function escapeProperty(s) { - return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +function mkdirP(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + (0, import_assert.ok)(fsPath, "a path argument must be provided"); + yield mkdir2(fsPath, { recursive: true }); + }); } -// node_modules/@actions/core/lib/file-command.js -var fs = __toESM(require("fs"), 1); -var os2 = __toESM(require("os"), 1); -function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); +// node_modules/@actions/tool-cache/lib/tool-cache.js +var crypto = __toESM(require("crypto"), 1); +var fs4 = __toESM(require("fs"), 1); + +// node_modules/@actions/tool-cache/lib/manifest.js +var semver = __toESM(require_semver2(), 1); + +// node_modules/@actions/tool-cache/lib/tool-cache.js +var path2 = __toESM(require("path"), 1); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var http = __toESM(require("http"), 1); +var https = __toESM(require("https"), 1); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +function getProxyUrl2(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return void 0; } - if (!fs.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); + const proxyVar = (() => { + if (usingSsl) { + return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + } else { + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } +} +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; + } + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; + } + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { + if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { + return true; + } } - fs.appendFileSync(filePath, `${toCommandValue(message)}${os2.EOL}`, { - encoding: "utf8" - }); + return false; } +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); +} +var DecodedURL = class extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } +}; -// node_modules/@actions/core/lib/core.js -var os4 = __toESM(require("os"), 1); -var path = __toESM(require("path"), 1); - -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js -var tunnel = __toESM(require_tunnel2(), 1); -var import_undici = __toESM(require_undici(), 1); -var HttpCodes; -(function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes || (HttpCodes = {})); -var Headers; -(function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; -})(Headers || (Headers = {})); -var MediaTypes; -(function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; -})(MediaTypes || (MediaTypes = {})); -var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; - -// node_modules/@actions/core/lib/summary.js -var import_os = require("os"); -var import_fs = require("fs"); -var __awaiter = function(thisArg, _arguments, P, generator) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var tunnel2 = __toESM(require_tunnel2(), 1); +var import_undici2 = __toESM(require_undici(), 1); +var __awaiter3 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); @@ -24876,322 +22598,803 @@ var __awaiter = function(thisArg, _arguments, P, generator) { step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var { access, appendFile, writeFile } = import_fs.promises; -var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; -var Summary = class { - constructor() { - this._buffer = ""; +var HttpCodes2; +(function(HttpCodes3) { + HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; + HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; + HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; + HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; + HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; + HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; + HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; + HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; + HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; + HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; + HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes2 || (HttpCodes2 = {})); +var Headers2; +(function(Headers3) { + Headers3["Accept"] = "accept"; + Headers3["ContentType"] = "content-type"; +})(Headers2 || (Headers2 = {})); +var MediaTypes2; +(function(MediaTypes3) { + MediaTypes3["ApplicationJson"] = "application/json"; +})(MediaTypes2 || (MediaTypes2 = {})); +var HttpRedirectCodes2 = [ + HttpCodes2.MovedPermanently, + HttpCodes2.ResourceMoved, + HttpCodes2.SeeOther, + HttpCodes2.TemporaryRedirect, + HttpCodes2.PermanentRedirect +]; +var HttpResponseRetryCodes2 = [ + HttpCodes2.BadGateway, + HttpCodes2.ServiceUnavailable, + HttpCodes2.GatewayTimeout +]; +var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; +var ExponentialBackoffCeiling = 10; +var ExponentialBackoffTimeSlice = 5; +var HttpClientError = class _HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = "HttpClientError"; + this.statusCode = statusCode; + Object.setPrototypeOf(this, _HttpClientError.prototype); } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); - } - try { - yield access(pathFromEnv, import_fs.constants.R_OK | import_fs.constants.W_OK); - } catch (_a) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); - } - this._filePath = pathFromEnv; - return this._filePath; +}; +var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter3(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter3(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", () => { + resolve(output.toString()); + }); + })); }); } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; + readBodyBuffer() { + return __awaiter3(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter3(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } +}; +var HttpClient2 = class { + constructor(userAgent3, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = this._getUserAgentWithOrchestrationId(userAgent3); + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } } - return `<${tag}${htmlAttrs}>${content}`; } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); + options(requestUrl, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); + get(requestUrl, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; + del(requestUrl, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; + post(requestUrl, data, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; + patch(requestUrl, data, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; + put(requestUrl, data, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(import_os.EOL); + head(requestUrl, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter3(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); + getJson(requestUrl_1) { + return __awaiter3(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); + postJson(requestUrl_1, obj_1) { + return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl_1, obj_1) { + return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl_1, obj_1) { + return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); + request(verb, requestUrl, data, headers) { + return __awaiter3(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error("Client has already been disposed."); + } + const parsedUrl = new URL(requestUrl); + let info2 = this._prepareRequest(verb, parsedUrl, headers); + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info2, data); + if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { + let authenticationHandler; + for (const handler2 of this.handlers) { + if (handler2.canHandleAuthentication(response)) { + authenticationHandler = handler2; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info2, data); + } else { + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && HttpRedirectCodes2.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { + const redirectUrl = response.message.headers["location"]; + if (!redirectUrl) { + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + } + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } + } + info2 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info2, data); + redirectsRemaining--; + } + if (!response.message.statusCode || !HttpResponseRetryCodes2.includes(response.message.statusCode)) { + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); } /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance + * Raw request. + * @param info + * @param data */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); + requestRaw(info2, data) { + return __awaiter3(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve(res); + } + } + this.requestRawWithCallback(info2, data, callbackForResult); + }); + }); } /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance + * Raw request with callback. + * @param info + * @param data + * @param onResult */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); + requestRawWithCallback(info2, data, onResult) { + if (typeof data === "string") { + if (!info2.options.headers) { + info2.options.headers = {}; + } + info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info2.httpModule.request(info2.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); + }); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info2.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); + } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); + } } /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = getProxyUrl2(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info2 = {}; + info2.parsedUrl = requestUrl; + const usingSsl = info2.parsedUrl.protocol === "https:"; + info2.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info2.options = {}; + info2.options.host = info2.parsedUrl.hostname; + info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort; + info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || ""); + info2.options.method = method; + info2.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info2.options.headers["user-agent"] = this.userAgent; + } + info2.options.agent = this._getAgent(info2.parsedUrl); + if (this.handlers) { + for (const handler2 of this.handlers) { + handler2.prepareRequest(info2.options); + } + } + return info2; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance + * Gets an existing header value or returns a default. + * Handles converting number header values to strings since HTTP headers must be strings. + * Note: This returns string | string[] since some headers can have multiple values. + * For headers that must always be a single string (like Content-Type), use the + * specialized _getExistingOrDefaultContentTypeHeader method instead. */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } + } + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default; } /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance + * Specialized version of _getExistingOrDefaultHeader for Content-Type header. + * Always returns a single string (not an array) since Content-Type should be a single value. + * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. + * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers + * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); + _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers2.ContentType]; + if (headerValue) { + if (typeof headerValue === "number") { + clientHeader = String(headerValue); + } else if (Array.isArray(headerValue)) { + clientHeader = headerValue.join(", "); + } else { + clientHeader = headerValue; + } + } + } + const additionalValue = additionalHeaders[Headers2.ContentType]; + if (additionalValue !== void 0) { + if (typeof additionalValue === "number") { + return String(additionalValue); + } else if (Array.isArray(additionalValue)) { + return additionalValue.join(", "); + } else { + return additionalValue; + } + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = getProxyUrl2(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (!useProxy) { + agent = this._agent; + } + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === "https:"; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; + } else { + tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === "https:"; + proxyAgent = new import_undici2.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` + })); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _getUserAgentWithOrchestrationId(userAgent3) { + const baseUserAgent = userAgent3 || "actions/http-client"; + const orchId = process.env["ACTIONS_ORCHESTRATION_ID"]; + if (orchId) { + const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); + return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; + } + return baseUserAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter3(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise((resolve) => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter3(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter3(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes2.NotFound) { + resolve(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } catch (err) { + } + if (statusCode > 299) { + let msg; + if (obj && obj.message) { + msg = obj.message; + } else if (contents && contents.length > 0) { + msg = contents; + } else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } else { + resolve(response); + } + })); + }); } }; -var _summary = new Summary(); - -// node_modules/@actions/core/lib/platform.js -var import_os2 = __toESM(require("os"), 1); - -// node_modules/@actions/core/node_modules/@actions/io/lib/io-util.js -var fs2 = __toESM(require("fs"), 1); -var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs2.promises; -var IS_WINDOWS = process.platform === "win32"; -var READONLY = fs2.constants.O_RDONLY; +var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); -// node_modules/@actions/core/node_modules/@actions/exec/lib/toolrunner.js -var IS_WINDOWS2 = process.platform === "win32"; +// node_modules/@actions/tool-cache/lib/tool-cache.js +var semver2 = __toESM(require_semver2(), 1); +var stream = __toESM(require("stream"), 1); +var util = __toESM(require("util"), 1); +var import_assert2 = require("assert"); -// node_modules/@actions/core/lib/platform.js -var platform = import_os2.default.platform(); -var arch = import_os2.default.arch(); +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var IS_WINDOWS4 = process.platform === "win32"; -// node_modules/@actions/core/lib/core.js -var ExitCode; -(function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; -})(ExitCode || (ExitCode = {})); -function addPath(inputPath) { - const filePath = process.env["GITHUB_PATH"] || ""; - if (filePath) { - issueFileCommand("PATH", inputPath); - } else { - issueCommand("add-path", {}, inputPath); +// node_modules/@actions/tool-cache/lib/retry-helper.js +var __awaiter4 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); } - process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`; -} -function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var RetryHelper = class { + constructor(maxAttempts, minSeconds, maxSeconds) { + if (maxAttempts < 1) { + throw new Error("max attempts should be greater than or equal to 1"); + } + this.maxAttempts = maxAttempts; + this.minSeconds = Math.floor(minSeconds); + this.maxSeconds = Math.floor(maxSeconds); + if (this.minSeconds > this.maxSeconds) { + throw new Error("min seconds should be less than or equal to max seconds"); + } } - if (options && options.trimWhitespace === false) { - return val; + execute(action, isRetryable) { + return __awaiter4(this, void 0, void 0, function* () { + let attempt = 1; + while (attempt < this.maxAttempts) { + try { + return yield action(); + } catch (err) { + if (isRetryable && !isRetryable(err)) { + throw err; + } + info(err.message); + } + const seconds = this.getSleepAmount(); + info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); + }); } - return val.trim(); -} -function debug(message) { - issueCommand("debug", {}, message); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; + } + sleep(seconds) { + return __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve) => setTimeout(resolve, seconds * 1e3)); + }); + } +}; + +// node_modules/@actions/tool-cache/lib/tool-cache.js +var __awaiter5 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var HTTPError = class extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); + } +}; +var IS_WINDOWS5 = process.platform === "win32"; +var IS_MAC = process.platform === "darwin"; +var userAgent = "actions/tool-cache"; +function downloadTool(url, dest, auth2, headers) { + return __awaiter5(this, void 0, void 0, function* () { + dest = dest || path2.join(_getTempDirectory(), crypto.randomUUID()); + yield mkdirP(path2.dirname(dest)); + debug(`Downloading ${url}`); + debug(`Destination ${dest}`); + const maxAttempts = 3; + const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); + const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); + const retryHelper = new RetryHelper(maxAttempts, minSeconds, maxSeconds); + return yield retryHelper.execute(() => __awaiter5(this, void 0, void 0, function* () { + return yield downloadToolAttempt(url, dest || "", auth2, headers); + }), (err) => { + if (err instanceof HTTPError && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; + }); + }); } -function error(message, properties = {}) { - issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +function downloadToolAttempt(url, dest, auth2, headers) { + return __awaiter5(this, void 0, void 0, function* () { + if (fs4.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http2 = new HttpClient2(userAgent, [], { + allowRetries: false + }); + if (auth2) { + debug("set auth"); + if (headers === void 0) { + headers = {}; + } + headers.authorization = auth2; + } + const response = yield http2.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError(response.message.statusCode); + debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline2 = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline2(readStream, fs4.createWriteStream(dest)); + debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + debug("download failed"); + try { + yield rmRF(dest); + } catch (err) { + debug(`Failed to delete '${dest}'. ${err.message}`); + } + } + } + }); } -function warning(message, properties = {}) { - issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +function _getTempDirectory() { + const tempDirectory = process.env["RUNNER_TEMP"] || ""; + (0, import_assert2.ok)(tempDirectory, "Expected RUNNER_TEMP to be defined"); + return tempDirectory; } -function info(message) { - process.stdout.write(message + os4.EOL); +function _getGlobal(key, defaultValue) { + const value = global[key]; + return value !== void 0 ? value : defaultValue; } -// src/index.ts -var tc = __toESM(require_tool_cache()); - // src/either.ts function error2(errors) { return { tag: "error", errors }; } -function ok(value) { +function ok3(value) { return { tag: "ok", value }; } function isOk(value) { @@ -25331,19 +23534,19 @@ var before_after_hook_default = { Singular, Collection }; // node_modules/@octokit/endpoint/dist-bundle/index.js var VERSION = "0.0.0-development"; -var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`; +var userAgent2 = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`; var DEFAULTS = { method: "GET", baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json", - "user-agent": userAgent + "user-agent": userAgent2 }, mediaType: { format: "" } }; -function lowercaseKeys(object) { +function lowercaseKeys2(object) { if (!object) { return {}; } @@ -25387,7 +23590,7 @@ function merge(defaults, route, options) { } else { options = Object.assign({}, route); } - options.headers = lowercaseKeys(options.headers); + options.headers = lowercaseKeys2(options.headers); removeUndefinedProperties(options); removeUndefinedProperties(options.headers); const mergedOptions = mergeDeep(defaults || {}, options); @@ -26156,17 +24359,17 @@ function requestLog(octokit) { octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path3 = requestOptions.url.replace(options.baseUrl, ""); + const path4 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { const requestId = response.headers["x-github-request-id"]; octokit.log.info( - `${requestOptions.method} ${path3} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path4} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` ); return response; }).catch((error3) => { const requestId = error3.response?.headers["x-github-request-id"] || "UNKNOWN"; octokit.log.error( - `${requestOptions.method} ${path3} - ${error3.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path4} - ${error3.status} with id ${requestId} in ${Date.now() - start}ms` ); throw error3; }); @@ -28879,7 +27082,7 @@ var triggers_notification_paths_default = [ ]; function routeMatcher(paths) { const regexes2 = paths.map( - (path3) => path3.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/") + (path4) => path4.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/") ); const regex2 = `^(?:${regexes2.map((r) => `(?:${r})`).join("|")})[^/]*$`; return new RegExp(regex2, "i"); @@ -29094,13 +27297,13 @@ function parseEnvironmentVariable(envVarName) { `expected environment variable '${envVarName}' to be non-empty` ]); } - return ok(value); + return ok3(value); } function parseToken(value) { if (value.length === 0) { return error2(["expected input.token to be non-empty"]); } - return ok(value); + return ok3(value); } function parseTargetReleaseVersion(value) { const { @@ -29128,12 +27331,12 @@ function parseTargetReleaseVersion(value) { tag: match[4], checksum: match[5] !== void 0 ? some(match[5]) : none() }; - return ok(target); + return ok3(target); } function parseTargetRelease(value) { const maybeTargetRelease = parseTargetReleaseVersion(value); if (isOk(maybeTargetRelease)) { - return ok(maybeTargetRelease.value); + return ok3(maybeTargetRelease.value); } return error2([ `input.targets contains invalid target -- '${value}' does not match expected format '{owner}/{repository}@{tag}' (example: EricCrosson/git-disjoint@v2)` @@ -29159,7 +27362,7 @@ function parseTargetReleases(value) { if (errors.length > 0) { return error2(errors); } - return ok(results); + return ok3(results); } // src/platform.ts @@ -29326,7 +27529,7 @@ To resolve, specify the desired binary with the target format ${slug.owner}/${sl // src/index.ts function getDestinationDirectory(storageDirectory, slug, tag, platform3, architecture) { - return path2.join( + return path3.join( storageDirectory, slug.owner.toLowerCase(), slug.repository.toLowerCase(), @@ -29359,19 +27562,19 @@ async function installGitHubReleaseBinary(octokit, targetRelease, storageDirecto releaseAsset.binaryName, targetRelease.slug.repository ); - const destinationFilename = path2.join( + const destinationFilename = path3.join( destinationDirectory, destinationBasename ); - fs3.mkdirSync(destinationDirectory, { recursive: true }); - await tc.downloadTool( + fs5.mkdirSync(destinationDirectory, { recursive: true }); + await downloadTool( releaseAsset.url, destinationFilename, `token ${token}`, { accept: "application/octet-stream" } ); if (isSome(targetRelease.checksum)) { - const fileBuffer = fs3.readFileSync(destinationFilename); + const fileBuffer = fs5.readFileSync(destinationFilename); const hash = (0, import_node_crypto.createHash)("sha256"); hash.update(fileBuffer); const calculatedChecksum = hash.digest("hex"); @@ -29388,7 +27591,7 @@ async function installGitHubReleaseBinary(octokit, targetRelease, storageDirecto ); } } - fs3.chmodSync(destinationFilename, "755"); + fs5.chmodSync(destinationFilename, "755"); addPath(destinationDirectory); } async function main() { @@ -29407,7 +27610,7 @@ async function main() { const token = unwrap(maybeToken); const targetReleases = unwrap(maybeTargetReleases); const homeDirectory = unwrap(maybeHomeDirectory); - const storageDirectory = path2.join( + const storageDirectory = path3.join( homeDirectory, ".install-github-release-binary", "bin" diff --git a/flake.lock b/flake.lock index c99c537..183796b 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,15 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "NixOS", "repo": "flake-compat", "type": "github" } @@ -33,14 +33,17 @@ }, "gitignore": { "inputs": { - "nixpkgs": ["pre-commit-hooks", "nixpkgs"] + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -51,11 +54,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1699099776, - "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", + "lastModified": 1776548001, + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", "owner": "nixos", "repo": "nixpkgs", - "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", "type": "github" }, "original": { @@ -65,36 +68,20 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1671271954, - "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05", - "repo": "nixpkgs", - "type": "github" - } - }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": ["flake-utils"], "gitignore": "gitignore", - "nixpkgs": ["nixpkgs"], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1672912243, - "narHash": "sha256-QnQeKUjco2kO9J4rBqIBPp5XcOMblIMnmyhpjeaJBYc=", + "lastModified": 1775585728, + "narHash": "sha256-8Psjt+TWvE4thRKktJsXfR6PA/fWWsZ04DVaY6PUhr4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "a4548c09eac4afb592ab2614f4a150120b29584c", + "rev": "580633fa3fe5fc0379905986543fd7495481913d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e5cdeac..06d685a 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,6 @@ flake-utils.url = "github:numtide/flake-utils"; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; - inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -33,7 +32,7 @@ in { devShells.default = pkgs.mkShell { buildInputs = [ - pkgs.nodejs_20 + pkgs.nodejs_24 ]; inherit (checks.pre-commit-check) shellHook; }; diff --git a/package-lock.json b/package-lock.json index 1fbfcbf..ec49239 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@actions/core": "3.0.0", - "@actions/tool-cache": "2.0.2", + "@actions/tool-cache": "4.0.0", "@octokit/plugin-retry": "8.1.0", "@octokit/plugin-throttling": "11.0.3", "@octokit/rest": "22.0.1", @@ -60,6 +60,7 @@ }, "node_modules/@actions/exec": { "version": "1.1.1", + "dev": true, "license": "MIT", "dependencies": { "@actions/io": "^1.0.1" @@ -69,35 +70,50 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz", "integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==", + "dev": true, "dependencies": { "tunnel": "^0.0.6" } }, "node_modules/@actions/io": { "version": "1.1.2", + "dev": true, "license": "MIT" }, "node_modules/@actions/tool-cache": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.2.tgz", - "integrity": "sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-4.0.0.tgz", + "integrity": "sha512-L8P9HbXvpvqjZDveb/fdsa55IVC0trfPgQ4ZwGo6r5af6YDVdM9vMGPZ7rgY2fAT9gGj4PSYd6bYlg3p3jD78A==", "dependencies": { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.0", - "@actions/http-client": "^2.0.1", - "@actions/io": "^1.1.1", - "semver": "^6.1.0" + "@actions/core": "^3.0.0", + "@actions/exec": "^3.0.0", + "@actions/http-client": "^4.0.0", + "@actions/io": "^3.0.0", + "semver": "^7.7.3" } }, - "node_modules/@actions/tool-cache/node_modules/@actions/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", - "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "node_modules/@actions/tool-cache/node_modules/@actions/exec": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-3.0.0.tgz", + "integrity": "sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==", "dependencies": { - "@actions/exec": "^1.1.1", - "@actions/http-client": "^2.0.1" + "@actions/io": "^3.0.2" } }, + "node_modules/@actions/tool-cache/node_modules/@actions/http-client": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz", + "integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^6.23.0" + } + }, + "node_modules/@actions/tool-cache/node_modules/@actions/io": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-3.0.2.tgz", + "integrity": "sha512-nRBchcMM+QK1pdjO7/idu86rbJI5YHUKCvKs0KxnSYbVe3F51UfGxuZX4Qy/fWlp6l7gWFwIkrOzN+oUK03kfw==" + }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -1273,20 +1289,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/semver": { - "version": "7.3.8", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@semantic-release/npm/node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -1773,18 +1775,6 @@ "node": ">=18" } }, - "node_modules/conventional-changelog-writer/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/conventional-commits-filter": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-5.0.0.tgz", @@ -2493,33 +2483,6 @@ "node": "14 || >=16.14" } }, - "node_modules/hosted-git-info/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/hosted-git-info/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/http-proxy-agent": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", @@ -2870,17 +2833,6 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/marked": { "version": "15.0.12", "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz", @@ -3043,21 +2995,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/normalize-url": { "version": "8.0.0", "dev": true, @@ -5752,18 +5689,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/semantic-release/node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -5804,10 +5729,14 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "license": "ISC", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver-regex": { @@ -6453,11 +6382,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/yargs": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", @@ -6592,6 +6516,7 @@ }, "@actions/exec": { "version": "1.1.1", + "dev": true, "requires": { "@actions/io": "^1.0.1" } @@ -6600,33 +6525,48 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz", "integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==", + "dev": true, "requires": { "tunnel": "^0.0.6" } }, "@actions/io": { - "version": "1.1.2" + "version": "1.1.2", + "dev": true }, "@actions/tool-cache": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.2.tgz", - "integrity": "sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-4.0.0.tgz", + "integrity": "sha512-L8P9HbXvpvqjZDveb/fdsa55IVC0trfPgQ4ZwGo6r5af6YDVdM9vMGPZ7rgY2fAT9gGj4PSYd6bYlg3p3jD78A==", "requires": { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.0", - "@actions/http-client": "^2.0.1", - "@actions/io": "^1.1.1", - "semver": "^6.1.0" + "@actions/core": "^3.0.0", + "@actions/exec": "^3.0.0", + "@actions/http-client": "^4.0.0", + "@actions/io": "^3.0.0", + "semver": "^7.7.3" }, "dependencies": { - "@actions/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", - "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "@actions/exec": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-3.0.0.tgz", + "integrity": "sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==", "requires": { - "@actions/exec": "^1.1.1", - "@actions/http-client": "^2.0.1" + "@actions/io": "^3.0.2" + } + }, + "@actions/http-client": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz", + "integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==", + "requires": { + "tunnel": "^0.0.6", + "undici": "^6.23.0" } + }, + "@actions/io": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-3.0.2.tgz", + "integrity": "sha512-nRBchcMM+QK1pdjO7/idu86rbJI5YHUKCvKs0KxnSYbVe3F51UfGxuZX4Qy/fWlp6l7gWFwIkrOzN+oUK03kfw==" } } }, @@ -7309,13 +7249,6 @@ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true }, - "semver": { - "version": "7.3.8", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, "signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -7656,14 +7589,6 @@ "handlebars": "^4.7.7", "meow": "^13.0.0", "semver": "^7.5.2" - }, - "dependencies": { - "semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true - } } }, "conventional-commits-filter": { @@ -8119,26 +8044,6 @@ "requires": { "semver": "^7.3.5" } - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - } - } } } }, @@ -8391,13 +8296,6 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", "dev": true }, - "lru-cache": { - "version": "6.0.0", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, "marked": { "version": "15.0.12", "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz", @@ -8506,17 +8404,6 @@ "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" - }, - "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "normalize-url": { @@ -10266,12 +10153,6 @@ "unicorn-magic": "^0.3.0" } }, - "semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true - }, "signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -10302,7 +10183,9 @@ "dev": true }, "semver": { - "version": "6.3.0" + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==" }, "semver-regex": { "version": "4.0.5", @@ -10717,10 +10600,6 @@ "version": "5.0.8", "dev": true }, - "yallist": { - "version": "4.0.0", - "dev": true - }, "yargs": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", diff --git a/package.json b/package.json index 4e69c58..82ab792 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@actions/core": "3.0.0", - "@actions/tool-cache": "2.0.2", + "@actions/tool-cache": "4.0.0", "@octokit/plugin-throttling": "11.0.3", "@octokit/rest": "22.0.1", "@octokit/plugin-retry": "8.1.0", diff --git a/tsconfig.json b/tsconfig.json index 921fd61..254fa29 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, + "types": ["node"], "outDir": "dist" } }