diff --git a/THIRD-PARTY b/THIRD-PARTY index 24c6a78..503c641 100644 --- a/THIRD-PARTY +++ b/THIRD-PARTY @@ -643,10 +643,10 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/client-sts@3.1038.0 + - @aws-sdk/client-sts@3.1044.0 - @aws-sdk/util-user-agent-browser@3.972.10 - - @aws-sdk/util-user-agent-node@3.973.22 - - @smithy/middleware-retry@4.5.6 + - @aws-sdk/util-user-agent-node@3.973.24 + - @smithy/middleware-retry@4.5.7 - @smithy/querystring-builder@4.2.14 - @smithy/querystring-parser@4.2.14 - @smithy/service-error-classification@4.3.1 @@ -864,9 +864,9 @@ The following npm packages may be included in this product: - @aws-sdk/middleware-host-header@3.972.10 - @aws-sdk/middleware-recursion-detection@3.972.11 - - @aws-sdk/middleware-sdk-s3@3.972.35 - - @aws-sdk/middleware-user-agent@3.972.36 - - @aws-sdk/signature-v4-multi-region@3.996.23 + - @aws-sdk/middleware-sdk-s3@3.972.37 + - @aws-sdk/middleware-user-agent@3.972.38 + - @aws-sdk/signature-v4-multi-region@3.996.25 - @smithy/core@3.23.17 - @smithy/invalid-dependency@4.2.14 - @smithy/middleware-serde@4.2.20 @@ -1240,7 +1240,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following npm package may be included in this product: - - @actions/http-client@3.0.2 + - @actions/http-client@4.0.1 This package contains the following license: @@ -1270,7 +1270,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following npm package may be included in this product: - - @aws-sdk/core@3.974.6 + - @aws-sdk/core@3.974.8 This package contains the following license: @@ -1690,16 +1690,16 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-env@3.972.32 - - @aws-sdk/credential-provider-ini@3.972.36 - - @aws-sdk/credential-provider-node@3.972.37 + - @aws-sdk/credential-provider-env@3.972.34 + - @aws-sdk/credential-provider-ini@3.972.38 + - @aws-sdk/credential-provider-node@3.972.39 - @aws-sdk/region-config-resolver@3.972.13 - - @aws-sdk/token-providers@3.1038.0 + - @aws-sdk/token-providers@3.1041.0 - @aws-sdk/types@3.973.8 - @aws-sdk/util-arn-parser@3.972.3 - @aws-sdk/util-endpoints@3.996.8 - @aws-sdk/util-locate-window@3.965.5 - - @aws-sdk/xml-builder@3.972.21 + - @aws-sdk/xml-builder@3.972.22 - @smithy/config-resolver@4.4.17 - @smithy/credential-provider-imds@4.2.14 - @smithy/fetch-http-handler@5.3.17 @@ -1933,9 +1933,9 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-process@3.972.32 - - @aws-sdk/credential-provider-sso@3.972.36 - - @aws-sdk/credential-provider-web-identity@3.972.36 + - @aws-sdk/credential-provider-process@3.972.34 + - @aws-sdk/credential-provider-sso@3.972.38 + - @aws-sdk/credential-provider-web-identity@3.972.38 These packages each contain the following license: @@ -2359,7 +2359,7 @@ The following npm packages may be included in this product: - @smithy/util-endpoints@3.4.2 - @smithy/util-middleware@4.2.14 - - @smithy/util-retry@4.3.5 + - @smithy/util-retry@4.3.8 These packages each contain the following license: @@ -2569,9 +2569,9 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-http@3.972.34 - - @aws-sdk/credential-provider-login@3.972.36 - - @aws-sdk/nested-clients@3.997.4 + - @aws-sdk/credential-provider-http@3.972.36 + - @aws-sdk/credential-provider-login@3.972.38 + - @aws-sdk/nested-clients@3.997.6 These packages each contain the following license: @@ -2581,7 +2581,7 @@ Apache-2.0 The following npm package may be included in this product: - - ip-address@10.0.1 + - ip-address@10.2.0 This package contains the following license: @@ -2668,7 +2668,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following npm package may be included in this product: - - basic-ftp@5.3.0 + - basic-ftp@5.3.1 This package contains the following license: @@ -2796,7 +2796,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following npm packages may be included in this product: - @nodable/entities@2.1.0 - - netmask@2.1.0 - quickjs-wasi@2.2.0 These packages each contain the following license: @@ -2805,6 +2804,36 @@ MIT ----------- +The following npm package may be included in this product: + + - netmask@2.1.1 + +This package contains the following license: + +MIT License + +Copyright (c) 2011 Olivier Poitrey rs@rhapsodyk.net + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----------- + The following npm package may be included in this product: - fast-xml-parser@5.7.2 @@ -2897,7 +2926,7 @@ SOFTWARE. The following npm package may be included in this product: - - fast-xml-builder@1.1.5 + - fast-xml-builder@1.1.9 This package contains the following license: @@ -2927,7 +2956,7 @@ SOFTWARE. The following npm package may be included in this product: - - undici@6.24.0 + - undici@6.25.0 This package contains the following license: @@ -3069,7 +3098,7 @@ THE SOFTWARE. The following npm package may be included in this product: - - socks@2.8.7 + - socks@2.8.8 This package contains the following license: @@ -3157,9 +3186,9 @@ SOFTWARE. The following npm packages may be included in this product: - - @actions/core@2.0.2 - - @actions/exec@2.0.0 - - @actions/io@2.0.0 + - @actions/core@3.0.1 + - @actions/exec@3.0.0 + - @actions/io@3.0.2 These packages each contain the following license: diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index e2a6694..4256724 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -30,287 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// node_modules/@actions/core/lib/utils.js -var require_utils = __commonJS({ - "node_modules/@actions/core/lib/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandValue = toCommandValue; - exports2.toCommandProperties = toCommandProperties; - 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 -var require_command = __commonJS({ - "node_modules/@actions/core/lib/command.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueCommand = issueCommand; - exports2.issue = issue; - var os = __importStar(require("os")); - var utils_1 = require_utils(); - function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); - } - function issue(name, message = "") { - issueCommand(name, {}, 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; - } - 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 (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty(s) { - return (0, utils_1.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 require_file_command = __commonJS({ - "node_modules/@actions/core/lib/file-command.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueFileCommand = issueFileCommand; - exports2.prepareKeyValueMessage = prepareKeyValueMessage; - var crypto = __importStar(require("crypto")); - var fs = __importStar(require("fs")); - var os = __importStar(require("os")); - var utils_1 = require_utils(); - function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { - encoding: "utf8" - }); - } - function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; - const convertedValue = (0, utils_1.toCommandValue)(value); - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; - } - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getProxyUrl = getProxyUrl; - exports2.checkBypass = checkBypass; - function getProxyUrl(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 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; - } - } - 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/tunnel/lib/tunnel.js var require_tunnel = __commonJS({ "node_modules/tunnel/lib/tunnel.js"(exports2) { @@ -322,28 +41,28 @@ var require_tunnel = __commonJS({ var events = require("events"); var assert = require("assert"); var util = require("util"); - exports2.httpOverHttp = httpOverHttp; - exports2.httpsOverHttp = httpsOverHttp; - exports2.httpOverHttps = httpOverHttps; - exports2.httpsOverHttps = httpsOverHttps; - function httpOverHttp(options) { + exports2.httpOverHttp = httpOverHttp2; + exports2.httpsOverHttp = httpsOverHttp2; + exports2.httpOverHttps = httpOverHttps2; + exports2.httpsOverHttps = httpsOverHttps2; + function httpOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } - function httpsOverHttp(options) { + function httpsOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } - function httpOverHttps(options) { + function httpOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } - function httpsOverHttps(options) { + function httpsOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; @@ -439,18 +158,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error.code = "ECONNRESET"; - options.request.emit("error", error); + var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error2.code = "ECONNRESET"; + options.request.emit("error", error2); self.removeSocket(placeholder); return; } if (head.length > 0) { debug2("got illegal response body from proxy"); socket.destroy(); - var error = new Error("got illegal response body from proxy"); - error.code = "ECONNRESET"; - options.request.emit("error", error); + var error2 = new Error("got illegal response body from proxy"); + error2.code = "ECONNRESET"; + options.request.emit("error", error2); self.removeSocket(placeholder); return; } @@ -465,9 +184,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error = new Error("tunneling socket could not be established, cause=" + cause.message); - error.code = "ECONNRESET"; - options.request.emit("error", error); + var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); + error2.code = "ECONNRESET"; + options.request.emit("error", error2); self.removeSocket(placeholder); } }; @@ -1796,14 +1515,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error + error: error2 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version, - error.message + error2.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -1834,14 +1553,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { request: { method, path, origin }, - error + error: error2 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, path, - error.message + error2.message ); }); isClientSet = true; @@ -1876,7 +1595,7 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error + error: error2 } = evt; debuglog( "connection to %s%s using %s%s errored - %s", @@ -1884,7 +1603,7 @@ var require_diagnostics = __commonJS({ port ? `:${port}` : "", protocol, version, - error.message + error2.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -2154,16 +1873,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error) { + onError(error2) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error }); + channels.error.publish({ request: this, error: error2 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error); + return this[kHandler].onError(error2); } onFinally() { if (this.errorHandler) { @@ -2327,13 +2046,20 @@ var require_dispatcher_base = __commonJS({ var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); + var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); var DispatcherBase = class extends Dispatcher { - constructor() { + constructor(opts) { super(); this[kDestroyed] = false; this[kOnDestroyed] = null; this[kClosed] = false; this[kOnClosed] = []; + this[kWebSocketOptions] = opts?.webSocket ?? {}; + } + get webSocketOptions() { + return { + maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 + }; } get destroyed() { return this[kDestroyed]; @@ -2886,7 +2612,7 @@ var require_connect = __commonJS({ }); // node_modules/undici/lib/llhttp/utils.js -var require_utils2 = __commonJS({ +var require_utils = __commonJS({ "node_modules/undici/lib/llhttp/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -2911,7 +2637,7 @@ var require_constants2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; - var utils_1 = require_utils2(); + var utils_1 = require_utils(); var ERROR; (function(ERROR2) { ERROR2[ERROR2["OK"] = 0] = "OK"; @@ -4284,11 +4010,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) { @@ -4561,7 +4287,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -4576,7 +4302,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); @@ -5640,8 +5366,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)); } @@ -5886,7 +5612,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r } throwIfAborted(object[kState]); const promise = createDeferredPromise(); - const errorSteps = (error) => promise.reject(error); + const errorSteps = (error2) => promise.reject(error2); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5981,7 +5707,7 @@ var require_client_h1 = __commonJS({ kResume, kHTTPContext } = require_symbols(); - var constants = require_constants2(); + var constants3 = require_constants2(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; var addListener = util.addListener; @@ -6053,7 +5779,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(constants.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -6148,19 +5874,19 @@ var require_client_h1 = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants.ERROR.PAUSED_UPGRADE) { + if (ret === constants3.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data.slice(offset)); - } else if (ret === constants.ERROR.PAUSED) { + } else if (ret === constants3.ERROR.PAUSED) { this.paused = true; socket.unshift(data.slice(offset)); - } else if (ret !== constants.ERROR.OK) { + } else if (ret !== constants3.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, constants.ERROR[ret], data.slice(offset)); + throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset)); } } catch (err) { util.destroy(socket, err); @@ -6335,7 +6061,7 @@ var require_client_h1 = __commonJS({ socket[kBlocking] = false; client[kResume](); } - return pause ? constants.ERROR.PAUSED : 0; + return pause ? constants3.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; @@ -6357,7 +6083,7 @@ var require_client_h1 = __commonJS({ } this.bytesRead += buf.length; if (request.onData(buf) === false) { - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } } onMessageComplete() { @@ -6392,13 +6118,13 @@ var require_client_h1 = __commonJS({ if (socket[kWriting]) { assert(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { @@ -7394,8 +7120,8 @@ var require_client_h2 = __commonJS({ } request.onRequestSent(); client[kResume](); - } catch (error) { - abort(error); + } catch (error2) { + abort(error2); } } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { @@ -7550,8 +7276,8 @@ var require_redirect_handler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error) { - this.handler.onError(error); + onError(error2) { + this.handler.onError(error2); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -7772,9 +7498,10 @@ var require_client = __commonJS({ autoSelectFamilyAttemptTimeout, // h2 maxConcurrentStreams, - allowH2 + allowH2, + webSocket } = {}) { - super(); + super({ webSocket }); if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); } @@ -8280,8 +8007,8 @@ var require_pool_base = __commonJS({ var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); var kStats = /* @__PURE__ */ Symbol("stats"); var PoolBase = class extends DispatcherBase { - constructor() { - super(); + constructor(opts) { + super(opts); this[kQueue] = new FixedQueue(); this[kClients] = []; this[kQueued] = 0; @@ -8452,7 +8179,6 @@ var require_pool = __commonJS({ allowH2, ...options } = {}) { - super(); if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError("invalid connections"); } @@ -8473,13 +8199,14 @@ var require_pool = __commonJS({ ...connect }); } + super(options); 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[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error) => { + this.on("connectionError", (origin2, targets, error2) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8672,7 +8399,6 @@ var require_agent = __commonJS({ } var Agent = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - super(); if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } @@ -8682,6 +8408,7 @@ var require_agent = __commonJS({ if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } + super(options); if (connect && typeof connect !== "function") { connect = { ...connect }; } @@ -8824,7 +8551,7 @@ var require_proxy_agent = __commonJS({ return this.#client.destroy(err); } }; - var ProxyAgent = class extends DispatcherBase { + var ProxyAgent2 = class extends DispatcherBase { constructor(opts) { super(); if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { @@ -8965,7 +8692,7 @@ var require_proxy_agent = __commonJS({ throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); } } - module2.exports = ProxyAgent; + module2.exports = ProxyAgent2; } }); @@ -8975,7 +8702,7 @@ 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 ProxyAgent = require_proxy_agent(); + var ProxyAgent2 = require_proxy_agent(); var Agent = require_agent(); var DEFAULT_PORTS = { "http:": 80, @@ -8999,13 +8726,13 @@ var require_env_http_proxy_agent = __commonJS({ this[kNoProxyAgent] = new Agent(agentOpts); const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }); + this[kHttpProxyAgent] = new ProxyAgent2({ ...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 ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }); + this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY }); } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent]; } @@ -10846,13 +10573,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error !== null) { + if (error2 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error); + handler.onError(error2); return true; } if (typeof delay === "number" && delay > 0) { @@ -10890,19 +10617,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error) { - if (error instanceof MockNotMatchedError) { + } catch (error2) { + if (error2 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error; + throw error2; } } } else { @@ -11067,11 +10794,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error) { - if (typeof error === "undefined") { + replyWithError(error2) { + if (typeof error2 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }); return new MockScope(newMockDispatch); } /** @@ -12032,12 +11759,12 @@ var require_headers = __commonJS({ append(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); - const exists = this[kHeadersMap].get(lowercaseName); - if (exists) { + const exists2 = this[kHeadersMap].get(lowercaseName); + if (exists2) { const delimiter = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { - name: exists.name, - value: `${exists.value}${delimiter}${value}` + name: exists2.name, + value: `${exists2.value}${delimiter}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); @@ -12162,7 +11889,7 @@ var require_headers = __commonJS({ } } }; - var Headers = class _Headers { + var Headers2 = class _Headers { #guard; #headersList; constructor(init = void 0) { @@ -12312,13 +12039,13 @@ var require_headers = __commonJS({ o.#headersList = list; } }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers; - Reflect.deleteProperty(Headers, "getHeadersGuard"); - Reflect.deleteProperty(Headers, "setHeadersGuard"); - Reflect.deleteProperty(Headers, "getHeadersList"); - Reflect.deleteProperty(Headers, "setHeadersList"); - iteratorMixin("Headers", Headers, kHeadersSortedMap, 0, 1); - Object.defineProperties(Headers.prototype, { + 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, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, @@ -12336,7 +12063,7 @@ var require_headers = __commonJS({ webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object") { const iterator = Reflect.get(V, Symbol.iterator); - if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { + if (!util.types.isProxy(V) && iterator === Headers2.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { @@ -12357,7 +12084,7 @@ var require_headers = __commonJS({ fill, // for test. compareHeaderName, - Headers, + Headers: Headers2, HeadersList, getHeadersGuard, setHeadersGuard, @@ -12371,7 +12098,7 @@ var require_headers = __commonJS({ var require_response = __commonJS({ "node_modules/undici/lib/web/fetch/response.js"(exports2, module2) { "use strict"; - var { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); + var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); var { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); var util = require_util(); var nodeUtil = require("node:util"); @@ -12449,7 +12176,7 @@ var require_response = __commonJS({ } init = webidl.converters.ResponseInit(init); this[kState] = makeResponse({}); - this[kHeaders] = new Headers(kConstruct); + this[kHeaders] = new Headers2(kConstruct); setHeadersGuard(this[kHeaders], "response"); setHeadersList(this[kHeaders], this[kState].headersList); let bodyWithType = null; @@ -12693,7 +12420,7 @@ var require_response = __commonJS({ function fromInnerResponse(innerResponse, guard) { const response = new Response(kConstruct); response[kState] = innerResponse; - response[kHeaders] = new Headers(kConstruct); + response[kHeaders] = new Headers2(kConstruct); setHeadersList(response[kHeaders], innerResponse.headersList); setHeadersGuard(response[kHeaders], guard); if (hasFinalizationRegistry && innerResponse.body?.stream) { @@ -12813,7 +12540,7 @@ 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, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); + var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); var util = require_util(); var nodeUtil = require("node:util"); @@ -13081,7 +12808,7 @@ var require_request2 = __commonJS({ requestFinalizer.register(ac, { signal, abort }, abort); } } - this[kHeaders] = new Headers(kConstruct); + this[kHeaders] = new Headers2(kConstruct); setHeadersList(this[kHeaders], request.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { @@ -13370,7 +13097,7 @@ var require_request2 = __commonJS({ const request = new Request(kConstruct); request[kState] = innerRequest; request[kSignal] = signal; - request[kHeaders] = new Headers(kConstruct); + request[kHeaders] = new Headers2(kConstruct); setHeadersList(request[kHeaders], innerRequest.headersList); setHeadersGuard(request[kHeaders], guard); return request; @@ -13589,17 +13316,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error) { + abort(error2) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error) { - error = new DOMException("The operation was aborted.", "AbortError"); + if (!error2) { + error2 = new DOMException("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error; - this.connection?.destroy(error); - this.emit("terminated", error); + this.serializedAbortReason = error2; + this.connection?.destroy(error2); + this.emit("terminated", error2); } }; function handleFetchDone(response) { @@ -13695,12 +13422,12 @@ var require_fetch = __commonJS({ ); } var markResourceTiming = performance.markResourceTiming; - function abortFetch(p, request, responseObject, error) { + function abortFetch(p, request, responseObject, error2) { if (p) { - p.reject(error); + p.reject(error2); } if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error).catch((err) => { + request.body.stream.cancel(error2).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13712,7 +13439,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error).catch((err) => { + response.body.stream.cancel(error2).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -14533,13 +14260,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error) { + onError(error2) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error); - fetchParams.controller.terminate(error); - reject(error); + this.body?.destroy(error2); + fetchParams.controller.terminate(error2); + reject(error2); }, onUpgrade(status, rawHeaders, socket) { if (status !== 101) { @@ -15002,8 +14729,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error) { - fr[kError] = error; + } catch (error2) { + fr[kError] = error2; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -15012,13 +14739,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error) { + } catch (error2) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error; + fr[kError] = error2; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -16408,10 +16135,10 @@ var require_cookies = __commonJS({ var { parseSetCookie } = require_parse(); var { stringify } = require_util6(); var { webidl } = require_webidl(); - var { Headers } = require_headers(); + var { Headers: Headers2 } = require_headers(); function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); - webidl.brandCheck(headers, Headers, { strict: false }); + webidl.brandCheck(headers, Headers2, { strict: false }); const cookie = headers.get("cookie"); const out = {}; if (!cookie) { @@ -16424,7 +16151,7 @@ var require_cookies = __commonJS({ return out; } function deleteCookie(headers, name, attributes) { - webidl.brandCheck(headers, Headers, { strict: false }); + webidl.brandCheck(headers, Headers2, { strict: false }); const prefix = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.DOMString(name, prefix, "name"); @@ -16438,7 +16165,7 @@ var require_cookies = __commonJS({ } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - webidl.brandCheck(headers, Headers, { strict: false }); + webidl.brandCheck(headers, Headers2, { strict: false }); const cookies = headers.getSetCookie(); if (!cookies) { return []; @@ -16447,7 +16174,7 @@ var require_cookies = __commonJS({ } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); - webidl.brandCheck(headers, Headers, { strict: false }); + webidl.brandCheck(headers, Headers2, { strict: false }); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { @@ -17049,13 +16776,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) { @@ -17068,7 +16795,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++]]; } @@ -17137,12 +16864,12 @@ var require_connection = __commonJS({ var { CloseEvent } = require_events(); var { makeRequest } = require_request2(); var { fetching } = require_fetch(); - var { Headers, getHeadersList } = require_headers(); + var { Headers: Headers2, 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) { @@ -17159,10 +16886,10 @@ var require_connection = __commonJS({ redirect: "error" }); if (options.headers) { - const headersList = getHeadersList(new Headers(options.headers)); + const headersList = getHeadersList(new Headers2(options.headers)); request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -17192,7 +16919,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; @@ -17290,11 +17017,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error) { + function onSocketError(error2) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error); + channels.socketError.publish(error2); } this.destroy(); } @@ -17315,31 +17042,26 @@ var require_permessage_deflate = __commonJS({ var tail = Buffer.from([0, 0, 255, 255]); var kBuffer = /* @__PURE__ */ Symbol("kBuffer"); var kLength = /* @__PURE__ */ Symbol("kLength"); - var kDefaultMaxDecompressedSize = 4 * 1024 * 1024; var PerMessageDeflate = class { /** @type {import('node:zlib').InflateRaw} */ #inflate; #options = {}; - /** @type {number} */ - #maxDecompressedSize; - /** @type {boolean} */ - #aborted = false; - /** @type {Function|null} */ - #currentCallback = null; + #maxPayloadSize = 0; /** * @param {Map} extensions - * @param {{ maxDecompressedMessageSize?: number }} [options] */ - constructor(extensions, options = {}) { + constructor(extensions, options) { this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); - this.#maxDecompressedSize = options.maxDecompressedMessageSize ?? kDefaultMaxDecompressedSize; + this.#maxPayloadSize = options.maxPayloadSize; } + /** + * Decompress a compressed payload. + * @param {Buffer} chunk Compressed data + * @param {boolean} fin Final fragment flag + * @param {Function} callback Callback function + */ decompress(chunk, fin, callback) { - if (this.#aborted) { - callback(new MessageSizeExceededError()); - return; - } if (!this.#inflate) { let windowBits = Z_DEFAULT_WINDOWBITS; if (this.#options.serverMaxWindowBits) { @@ -17358,20 +17080,11 @@ var require_permessage_deflate = __commonJS({ this.#inflate[kBuffer] = []; this.#inflate[kLength] = 0; this.#inflate.on("data", (data) => { - if (this.#aborted) { - return; - } this.#inflate[kLength] += data.length; - if (this.#inflate[kLength] > this.#maxDecompressedSize) { - this.#aborted = true; + if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { + callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); - this.#inflate.destroy(); this.#inflate = null; - if (this.#currentCallback) { - const cb = this.#currentCallback; - this.#currentCallback = null; - cb(new MessageSizeExceededError()); - } return; } this.#inflate[kBuffer].push(data); @@ -17381,19 +17094,17 @@ var require_permessage_deflate = __commonJS({ callback(err); }); } - this.#currentCallback = callback; this.#inflate.write(chunk); if (fin) { this.#inflate.write(tail); } this.#inflate.flush(() => { - if (this.#aborted || !this.#inflate) { + if (!this.#inflate) { return; } const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); this.#inflate[kBuffer].length = 0; this.#inflate[kLength] = 0; - this.#currentCallback = null; callback(null, full); }); } @@ -17424,8 +17135,10 @@ var require_receiver = __commonJS({ var { WebsocketFrameSend } = require_frame(); var { closeWebSocketConnection } = require_connection(); var { PerMessageDeflate } = require_permessage_deflate(); + var { MessageSizeExceededError } = require_errors(); var ByteParser = class extends Writable { #buffers = []; + #fragmentsBytes = 0; #byteOffset = 0; #loop = false; #state = parserStates.INFO; @@ -17433,18 +17146,18 @@ var require_receiver = __commonJS({ #fragments = []; /** @type {Map} */ #extensions; - /** @type {{ maxDecompressedMessageSize?: number }} */ - #options; + /** @type {number} */ + #maxPayloadSize; /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxDecompressedMessageSize?: number }} [options] + * @param {{ maxPayloadSize?: number }} [options] */ constructor(ws, extensions, options = {}) { super(); this.ws = ws; this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; - this.#options = options; + this.#maxPayloadSize = options.maxPayloadSize ?? 0; if (this.#extensions.has("permessage-deflate")) { this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options)); } @@ -17459,6 +17172,13 @@ var require_receiver = __commonJS({ this.#loop = true; this.run(callback); } + #validatePayloadLength() { + if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, "Payload size exceeds maximum allowed size"); + return false; + } + return true; + } /** * Runs whenever a new chunk is received. * Callback is called whenever there are no more chunks buffering, @@ -17518,6 +17238,9 @@ var require_receiver = __commonJS({ if (payloadLength <= 125) { this.#info.payloadLength = payloadLength; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16; } else if (payloadLength === 127) { @@ -17538,6 +17261,9 @@ var require_receiver = __commonJS({ const buffer = this.consume(2); this.#info.payloadLength = buffer.readUInt16BE(0); this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback(); @@ -17551,6 +17277,9 @@ var require_receiver = __commonJS({ } this.#info.payloadLength = lower; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { return callback(); @@ -17561,32 +17290,41 @@ var require_receiver = __commonJS({ this.#state = parserStates.INFO; } else { if (!this.#info.compressed) { - this.#fragments.push(body); + this.writeFragments(body); + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, new MessageSizeExceededError().message); + return; + } if (!this.#info.fragmented && this.#info.fin) { - const fullMessage = Buffer.concat(this.#fragments); - websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage); - this.#fragments.length = 0; + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); } this.#state = parserStates.INFO; } else { - this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => { - if (error) { - failWebsocketConnection(this.ws, error.message); - return; - } - this.#fragments.push(data); - if (!this.#info.fin) { - this.#state = parserStates.INFO; + this.#extensions.get("permessage-deflate").decompress( + body, + this.#info.fin, + (error2, data) => { + if (error2) { + failWebsocketConnection(this.ws, error2.message); + return; + } + this.writeFragments(data); + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, new MessageSizeExceededError().message); + return; + } + if (!this.#info.fin) { + this.#state = parserStates.INFO; + this.#loop = true; + this.run(callback); + return; + } + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); this.#loop = true; + this.#state = parserStates.INFO; this.run(callback); - return; } - websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments)); - this.#loop = true; - this.#state = parserStates.INFO; - this.#fragments.length = 0; - this.run(callback); - }); + ); this.#loop = false; break; } @@ -17629,6 +17367,21 @@ var require_receiver = __commonJS({ this.#byteOffset -= n; return buffer; } + writeFragments(fragment) { + this.#fragmentsBytes += fragment.length; + this.#fragments.push(fragment); + } + consumeFragments() { + const fragments = this.#fragments; + if (fragments.length === 1) { + this.#fragmentsBytes = 0; + return fragments.shift(); + } + const output = Buffer.concat(fragments, this.#fragmentsBytes); + this.#fragments = []; + this.#fragmentsBytes = 0; + return output; + } parseCloseBody(data) { assert(data.length !== 1); let code; @@ -17840,8 +17593,6 @@ var require_websocket = __commonJS({ #extensions = ""; /** @type {SendQueue} */ #sendQueue; - /** @type {{ maxDecompressedMessageSize?: number }} */ - #options; /** * @param {string} url * @param {string|string[]} protocols @@ -17885,9 +17636,6 @@ var require_websocket = __commonJS({ throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } this[kWebSocketURL] = new URL(urlRecord.href); - this.#options = { - maxDecompressedMessageSize: options.maxDecompressedMessageSize - }; const client = environmentSettingsObject.settingsObject; this[kController] = establishWebSocketConnection( urlRecord, @@ -18071,7 +17819,10 @@ var require_websocket = __commonJS({ */ #onConnectionEstablished(response, parsedExtensions) { this[kResponse] = response; - const parser = new ByteParser(this, parsedExtensions, this.#options); + const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize; + const parser = new ByteParser(this, parsedExtensions, { + maxPayloadSize + }); parser.on("drain", onParserDrain); parser.on("error", onParserError.bind(this)); response.socket.ws = this; @@ -18146,19 +17897,6 @@ var require_websocket = __commonJS({ { key: "headers", converter: webidl.nullableConverter(webidl.converters.HeadersInit) - }, - { - key: "maxDecompressedMessageSize", - converter: webidl.nullableConverter((V) => { - V = webidl.converters["unsigned long long"](V); - if (V <= 0) { - throw webidl.errors.exception({ - header: "WebSocket constructor", - message: "maxDecompressedMessageSize must be greater than 0" - }); - } - return V; - }) } ]); webidl.converters["DOMString or sequence or WebSocketInit"] = function(V) { @@ -18621,8 +18359,8 @@ var require_eventsource = __commonJS({ pipeline( response.body.stream, eventSourceStream, - (error) => { - if (error?.aborted === false) { + (error2) => { + if (error2?.aborted === false) { this.close(); this.dispatchEvent(new Event("error")); } @@ -18762,7 +18500,7 @@ var require_undici = __commonJS({ var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent = require_agent(); - var ProxyAgent = require_proxy_agent(); + var ProxyAgent2 = require_proxy_agent(); var EnvHttpProxyAgent = require_env_http_proxy_agent(); var RetryAgent = require_retry_agent(); var errors = require_errors(); @@ -18785,7 +18523,7 @@ var require_undici = __commonJS({ module2.exports.Pool = Pool; module2.exports.BalancedPool = BalancedPool; module2.exports.Agent = Agent; - module2.exports.ProxyAgent = ProxyAgent; + module2.exports.ProxyAgent = ProxyAgent2; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.RetryAgent = RetryAgent; module2.exports.RetryHandler = RetryHandler; @@ -18895,2714 +18633,510 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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.HttpClient = exports2.HttpClientResponse = exports2.HttpClientError = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - exports2.getProxyUrl = getProxyUrl; - exports2.isHttps = isHttps; - var http = __importStar(require("http")); - var https = __importStar(require("https")); - var pm = __importStar(require_proxy()); - var tunnel = __importStar(require_tunnel2()); - var undici_1 = require_undici(); - 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 || (exports2.HttpCodes = HttpCodes = {})); - var Headers; - (function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; - })(Headers || (exports2.Headers = Headers = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes || (exports2.MediaTypes = MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.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 __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(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 __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(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:"; - } - var HttpClient = class { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(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_1) { - return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl_1, obj_1) { - return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl_1, obj_1) { - return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.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 __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info = 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(info, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.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]; - } - } - } - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return __awaiter(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(info, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - if (typeof data === "string") { - if (!info.options.headers) { - info.options.headers = {}; - } - info.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info.httpModule.request(info.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: ${info.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(); - } - } - /** - * 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); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === "https:"; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; - info.options.path = (info.parsedUrl.pathname || "") + (info.parsedUrl.search || ""); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers["user-agent"] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info.options); - } - } - return info; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - /** - * 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. - */ - _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; - } - /** - * 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]). - */ - _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType]; - if (headerValue) { - if (typeof headerValue === "number") { - clientHeader = String(headerValue); - } else if (Array.isArray(headerValue)) { - clientHeader = headerValue.join(", "); - } else { - clientHeader = headerValue; - } - } - } - const additionalValue = additionalHeaders[Headers.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 = pm.getProxyUrl(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 ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.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 undici_1.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(userAgent) { - const baseUserAgent = userAgent || "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 __awaiter(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 __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.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); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "node_modules/@actions/http-client/lib/auth.js"(exports2) { - "use strict"; - var __awaiter = 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; - } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; - } - // 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"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; - } - // 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")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { - "use strict"; - var __awaiter = 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.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient = 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) { - return __awaiter(this, void 0, void 0, function* () { - var _a; - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error.statusCode} - - Error Message: ${error.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 __awaiter(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 (error) { - throw new Error(`Error message: ${error.message}`); - } - }); - } - }; - exports2.OidcClient = OidcClient; - } -}); - -// node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "node_modules/@actions/core/lib/summary.js"(exports2) { - "use strict"; - var __awaiter = 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.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, appendFile, writeFile } = 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 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[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.`); - } - try { - yield access(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.`); - } - 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(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 _summary = new Summary(); - exports2.markdownSummary = _summary; - exports2.summary = _summary; - } -}); - -// node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPosixPath = toPosixPath; - exports2.toWin32Path = toWin32Path; - exports2.toPlatformPath = toPlatformPath; - var path = __importStar(require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path.sep); - } - } -}); - -// 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; - 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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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 _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - exports2.readlink = readlink; - exports2.exists = exists; - exports2.isDirectory = isDirectory; - exports2.isRooted = isRooted; - exports2.tryGetExecutablePath = tryGetExecutablePath; - exports2.getCmdPath = getCmdPath; - var fs = __importStar(require("fs")); - var path = __importStar(require("path")); - _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield fs.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - try { - yield (0, exports2.stat)(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; - } - return true; - }); - } - function isDirectory(fsPath_1) { - return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) { - const stats = useStat ? yield (0, exports2.stat)(fsPath) : yield (0, exports2.lstat)(fsPath); - return stats.isDirectory(); - }); - } - function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); - } - return p.startsWith("/"); - } - function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - } - return ""; - }); - } - 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 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); - } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } - } -}); - -// 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; - 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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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.cp = cp; - exports2.mv = mv; - exports2.rmRF = rmRF; - exports2.mkdirP = mkdirP; - exports2.which = which; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path = __importStar(require("path")); - var ioUtil = __importStar(require_io_util()); - function cp(source_1, dest_1) { - return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { - 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 ? path.join(dest, path.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path.join(dest, path.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } - } - } - yield mkdirP(path.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter(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 { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 - }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); - } - }); - } - function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ""; - }); - } - function findInPath(tool) { - return __awaiter(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(path.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(path.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } - } - return matches; - }); - } - 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 __awaiter(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter(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); - } - } - 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); - } - }); - } - } -}); - -// node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner = __commonJS({ - "node_modules/@actions/exec/lib/toolrunner.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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.ToolRunner = void 0; - exports2.argStringToArray = argStringToArray; - var os = __importStar(require("os")); - var events = __importStar(require("events")); - var child = __importStar(require("child_process")); - var path = __importStar(require("path")); - var io = __importStar(require_io()); - var ioUtil = __importStar(require_io_util()); - var timers_1 = require("timers"); - var IS_WINDOWS = process.platform === "win32"; - var ToolRunner = 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_WINDOWS) { - 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}`; - } - } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } - } else { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - return cmd; - } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); - } - return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; - } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } - } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } - } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); - } - _windowsQuoteCmdArg(arg) { - 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; - } - 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(""); - } - _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; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => __awaiter(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) + os.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", (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error("child process missing stdin"); - } - cp.stdin.end(this.options.input); - } - })); - }); - } - }; - exports2.ToolRunner = ToolRunner; - function argStringToArray(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); - } - continue; - } - if (c === "\\" && escaped) { - append(c); - continue; - } - if (c === "\\" && inQuotes) { - escaped = true; - continue; - } - if (c === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; - } - 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"); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit("debug", message); - } - _setResult() { - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit("done", error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / 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); - } - state._setResult(); - } - }; - } -}); - -// node_modules/@actions/exec/lib/exec.js -var require_exec = __commonJS({ - "node_modules/@actions/exec/lib/exec.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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.exec = exec; - exports2.getExecOutput = getExecOutput; - var string_decoder_1 = require("string_decoder"); - var tr = __importStar(require_toolrunner()); - function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); - } - function getExecOutput(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b; - 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 - }; - }); - } - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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 __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; - exports2.getDetails = getDetails; - var os_1 = __importDefault(require("os")); - var exec = __importStar(require_exec()); - var getWindowsInfo = () => __awaiter(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 = () => __awaiter(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 = () => __awaiter(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 __awaiter(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 - }); - }); - } - } -}); - -// node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.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 || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - } - __setModuleDefault(result, mod); - return result; - }; - })(); - var __awaiter = 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.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable3; - exports2.setSecret = setSecret2; - exports2.addPath = addPath; - exports2.getInput = getInput3; - exports2.getMultilineInput = getMultilineInput; - exports2.getBooleanInput = getBooleanInput2; - exports2.setOutput = setOutput2; - exports2.setCommandEcho = setCommandEcho; - exports2.setFailed = setFailed2; - exports2.isDebug = isDebug; - exports2.debug = debug2; - exports2.error = error; - exports2.warning = warning; - exports2.notice = notice; - exports2.info = info; - exports2.startGroup = startGroup; - exports2.endGroup = endGroup; - exports2.group = group; - exports2.saveState = saveState; - exports2.getState = getState; - exports2.getIDToken = getIDToken; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os = __importStar(require("os")); - var path = __importStar(require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable3(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); - } - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - function addPath(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}${path.delimiter}${process.env["PATH"]}`; - } - function getInput3(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 (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); - } - function getMultilineInput(name, options) { - const inputs = getInput3(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - function getBooleanInput2(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput3(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - 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\``); - } - function setOutput2(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(os.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - function setFailed2(message) { - process.exitCode = ExitCode.Failure; - error(message); - } - function isDebug() { - return process.env["RUNNER_DEBUG"] === "1"; - } - function debug2(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - function error(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function warning(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function notice(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function info(message) { - process.stdout.write(message + os.EOL); - } - function startGroup(name) { - (0, command_1.issue)("group", name); - } - function endGroup() { - (0, command_1.issue)("endgroup"); - } - function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } finally { - endGroup(); - } - return result; - }); - } - 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)); - } - function getState(name) { - return process.env[`STATE_${name}`] || ""; - } - function getIDToken(aud) { - return __awaiter(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - 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()); - } -}); - // src/cleanup/index.ts var index_exports = {}; __export(index_exports, { cleanup: () => cleanup }); module.exports = __toCommonJS(index_exports); -var core2 = __toESM(require_core()); + +// 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 crypto = __toESM(require("crypto"), 1); +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" + }); +} +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = toCommandValue(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; +} + +// 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) { + 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(); + +// node_modules/@actions/core/lib/platform.js +var import_os2 = __toESM(require("os"), 1); + +// 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/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 exportVariable(name, val) { + const convertedVal = toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return issueFileCommand("ENV", prepareKeyValueMessage(name, val)); + } + issueCommand("set-env", { name }, convertedVal); +} +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}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); +} +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +function error(message, properties = {}) { + issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} // src/helpers.ts -var core = __toESM(require_core()); -function errorMessage(error) { - return error instanceof Error ? error.message : String(error); +function errorMessage(error2) { + return error2 instanceof Error ? error2.message : String(error2); } function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; const optionsWithoutDefault = { ...options }; delete optionsWithoutDefault.default; - const val = core.getInput(name, optionsWithoutDefault); + const val = getInput(name, optionsWithoutDefault); if (trueValue.includes(val)) return true; if (falseValue.includes(val)) return false; if (val === "") return options?.default ?? false; @@ -21614,27 +19148,27 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` // src/cleanup/index.ts function cleanup() { - const awsProfile = core2.getInput("aws-profile", { required: false }); + const awsProfile = getInput("aws-profile", { required: false }); if (getBooleanInput("output-env-credentials", { required: false, default: !awsProfile })) { try { - core2.exportVariable("AWS_ACCESS_KEY_ID", ""); - core2.exportVariable("AWS_SECRET_ACCESS_KEY", ""); - core2.exportVariable("AWS_SESSION_TOKEN", ""); - core2.exportVariable("AWS_DEFAULT_REGION", ""); - core2.exportVariable("AWS_REGION", ""); - if (core2.getInput("aws-profile")) { - core2.exportVariable("AWS_PROFILE", ""); + exportVariable("AWS_ACCESS_KEY_ID", ""); + exportVariable("AWS_SECRET_ACCESS_KEY", ""); + exportVariable("AWS_SESSION_TOKEN", ""); + exportVariable("AWS_DEFAULT_REGION", ""); + exportVariable("AWS_REGION", ""); + if (getInput("aws-profile")) { + exportVariable("AWS_PROFILE", ""); } - } catch (error) { - core2.setFailed(errorMessage(error)); + } catch (error2) { + setFailed(errorMessage(error2)); } } } if (require.main === module) { try { cleanup(); - } catch (error) { - core2.setFailed(errorMessage(error)); + } catch (error2) { + setFailed(errorMessage(error2)); } } // Annotate the CommonJS export names for ESM import in node: diff --git a/dist/index.js b/dist/index.js index abaf387..c943d61 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33,322 +33,41 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// node_modules/@actions/core/lib/utils.js -var require_utils = __commonJS({ - "node_modules/@actions/core/lib/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandValue = toCommandValue; - exports2.toCommandProperties = toCommandProperties; - 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 -var require_command = __commonJS({ - "node_modules/@actions/core/lib/command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueCommand = issueCommand; - exports2.issue = issue; - var os3 = __importStar2(require("os")); - var utils_1 = require_utils(); - function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os3.EOL); - } - function issue(name, message = "") { - issueCommand(name, {}, 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; - } - 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 (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function escapeProperty(s) { - return (0, utils_1.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 require_file_command = __commonJS({ - "node_modules/@actions/core/lib/file-command.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.issueFileCommand = issueFileCommand; - exports2.prepareKeyValueMessage = prepareKeyValueMessage; - var crypto3 = __importStar2(require("crypto")); - var fs3 = __importStar2(require("fs")); - var os3 = __importStar2(require("os")); - var utils_1 = require_utils(); - function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs3.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { - encoding: "utf8" - }); - } - function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto3.randomUUID()}`; - const convertedValue = (0, utils_1.toCommandValue)(value); - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; - } - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getProxyUrl = getProxyUrl; - exports2.checkBypass = checkBypass; - function getProxyUrl(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 DecodedURL(proxyVar); - } catch (_a2) { - 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; - } - } - 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/tunnel/lib/tunnel.js var require_tunnel = __commonJS({ "node_modules/tunnel/lib/tunnel.js"(exports2) { "use strict"; var net11 = require("net"); var tls8 = require("tls"); - var http5 = require("http"); - var https4 = require("https"); + var http6 = require("http"); + var https5 = require("https"); var events = require("events"); var assert4 = require("assert"); var util = require("util"); - exports2.httpOverHttp = httpOverHttp; - exports2.httpsOverHttp = httpsOverHttp; - exports2.httpOverHttps = httpOverHttps; - exports2.httpsOverHttps = httpsOverHttps; - function httpOverHttp(options) { + exports2.httpOverHttp = httpOverHttp2; + exports2.httpsOverHttp = httpsOverHttp2; + exports2.httpOverHttps = httpOverHttps2; + exports2.httpsOverHttps = httpsOverHttps2; + function httpOverHttp2(options) { var agent = new TunnelingAgent(options); - agent.request = http5.request; + agent.request = http6.request; return agent; } - function httpsOverHttp(options) { + function httpsOverHttp2(options) { var agent = new TunnelingAgent(options); - agent.request = http5.request; + agent.request = http6.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } - function httpOverHttps(options) { + function httpOverHttps2(options) { var agent = new TunnelingAgent(options); - agent.request = https4.request; + agent.request = https5.request; return agent; } - function httpsOverHttps(options) { + function httpsOverHttps2(options) { var agent = new TunnelingAgent(options); - agent.request = https4.request; + agent.request = https5.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; @@ -357,7 +76,7 @@ var require_tunnel = __commonJS({ var self = this; self.options = options || {}; self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http5.Agent.defaultMaxSockets; + self.maxSockets = self.options.maxSockets || http6.Agent.defaultMaxSockets; self.requests = []; self.sockets = []; self.on("free", function onFree(socket, host, port, localAddress) { @@ -417,7 +136,7 @@ var require_tunnel = __commonJS({ connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } - debug19("making CONNECT request"); + debug17("making CONNECT request"); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); @@ -437,40 +156,40 @@ var require_tunnel = __commonJS({ connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { - debug19( + debug17( "tunneling socket could not be established, statusCode=%d", res.statusCode ); socket.destroy(); - var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); return; } if (head.length > 0) { - debug19("got illegal response body from proxy"); + debug17("got illegal response body from proxy"); socket.destroy(); - var error2 = new Error("got illegal response body from proxy"); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); return; } - debug19("tunneling connection has established"); + debug17("tunneling connection has established"); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); - debug19( + debug17( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack ); - var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); } }; @@ -525,9 +244,9 @@ var require_tunnel = __commonJS({ } return target; } - var debug19; + var debug17; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug19 = function() { + debug17 = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; @@ -537,10 +256,10 @@ var require_tunnel = __commonJS({ console.error.apply(console, args); }; } else { - debug19 = function() { + debug17 = function() { }; } - exports2.debug = debug19; + exports2.debug = debug17; } }); @@ -1799,14 +1518,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error: error2 + error: error3 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version, - error2.message + error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -1837,14 +1556,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { request: { method, path: path3, origin }, - error: error2 + error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, path3, - error2.message + error3.message ); }); isClientSet = true; @@ -1879,7 +1598,7 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error: error2 + error: error3 } = evt; debuglog( "connection to %s%s using %s%s errored - %s", @@ -1887,7 +1606,7 @@ var require_diagnostics = __commonJS({ port ? `:${port}` : "", protocol, version, - error2.message + error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -2157,16 +1876,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error2) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error2 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error2); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -2330,13 +2049,20 @@ var require_dispatcher_base = __commonJS({ var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); + var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); var DispatcherBase = class extends Dispatcher { - constructor() { + constructor(opts) { super(); this[kDestroyed] = false; this[kOnDestroyed] = null; this[kClosed] = false; this[kOnClosed] = []; + this[kWebSocketOptions] = opts?.webSocket ?? {}; + } + get webSocketOptions() { + return { + maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 + }; } get destroyed() { return this[kDestroyed]; @@ -2889,7 +2615,7 @@ var require_connect = __commonJS({ }); // node_modules/undici/lib/llhttp/utils.js -var require_utils2 = __commonJS({ +var require_utils = __commonJS({ "node_modules/undici/lib/llhttp/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -2914,7 +2640,7 @@ var require_constants2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; - var utils_1 = require_utils2(); + var utils_1 = require_utils(); var ERROR; (function(ERROR2) { ERROR2[ERROR2["OK"] = 0] = "OK"; @@ -4287,11 +4013,11 @@ var require_util2 = __commonJS({ var { isUint8Array } = require("node:util/types"); var { webidl } = require_webidl(); var supportedHashes = []; - var crypto3; + var crypto4; try { - crypto3 = require("node:crypto"); + crypto4 = require("node:crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto4.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -4564,7 +4290,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto3 === void 0) { + if (crypto4 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -4579,7 +4305,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto4.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -5643,8 +5369,8 @@ var require_body = __commonJS({ var { multipartFormDataParser } = require_formdata_parser(); var random; try { - const crypto3 = require("node:crypto"); - random = (max) => crypto3.randomInt(0, max); + const crypto4 = require("node:crypto"); + random = (max) => crypto4.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5889,7 +5615,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r } throwIfAborted(object[kState]); const promise = createDeferredPromise(); - const errorSteps = (error2) => promise.reject(error2); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data3) => { try { promise.resolve(convertBytesToJSValue(data3)); @@ -5984,7 +5710,7 @@ var require_client_h1 = __commonJS({ kResume, kHTTPContext } = require_symbols(); - var constants = require_constants2(); + var constants3 = require_constants2(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; var addListener = util.addListener; @@ -6056,7 +5782,7 @@ var require_client_h1 = __commonJS({ constructor(client, socket, { exports: exports3 }) { assert4(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -6151,19 +5877,19 @@ var require_client_h1 = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants.ERROR.PAUSED_UPGRADE) { + if (ret === constants3.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data3.slice(offset)); - } else if (ret === constants.ERROR.PAUSED) { + } else if (ret === constants3.ERROR.PAUSED) { this.paused = true; socket.unshift(data3.slice(offset)); - } else if (ret !== constants.ERROR.OK) { + } else if (ret !== constants3.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, constants.ERROR[ret], data3.slice(offset)); + throw new HTTPParserError(message, constants3.ERROR[ret], data3.slice(offset)); } } catch (err) { util.destroy(socket, err); @@ -6338,7 +6064,7 @@ var require_client_h1 = __commonJS({ socket[kBlocking] = false; client[kResume](); } - return pause ? constants.ERROR.PAUSED : 0; + return pause ? constants3.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; @@ -6360,7 +6086,7 @@ var require_client_h1 = __commonJS({ } this.bytesRead += buf.length; if (request.onData(buf) === false) { - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } } onMessageComplete() { @@ -6395,13 +6121,13 @@ var require_client_h1 = __commonJS({ if (socket[kWriting]) { assert4(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); - return constants.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { @@ -7397,8 +7123,8 @@ var require_client_h2 = __commonJS({ } request.onRequestSent(); client[kResume](); - } catch (error2) { - abort(error2); + } catch (error3) { + abort(error3); } } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { @@ -7553,8 +7279,8 @@ var require_redirect_handler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error2) { - this.handler.onError(error2); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume3, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -7679,7 +7405,7 @@ var require_client = __commonJS({ "use strict"; var assert4 = require("node:assert"); var net11 = require("node:net"); - var http5 = require("node:http"); + var http6 = require("node:http"); var util = require_util(); var { channels } = require_diagnostics(); var Request2 = require_request(); @@ -7775,9 +7501,10 @@ var require_client = __commonJS({ autoSelectFamilyAttemptTimeout, // h2 maxConcurrentStreams, - allowH2 + allowH2, + webSocket } = {}) { - super(); + super({ webSocket }); if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); } @@ -7866,7 +7593,7 @@ var require_client = __commonJS({ this[kUrl] = util.parseOrigin(url); this[kConnector] = connect14; this[kPipelining] = pipelining != null ? pipelining : 1; - this[kMaxHeadersSize] = maxHeaderSize || http5.maxHeaderSize; + this[kMaxHeadersSize] = maxHeaderSize || http6.maxHeaderSize; this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold; @@ -8283,8 +8010,8 @@ var require_pool_base = __commonJS({ var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); var kStats = /* @__PURE__ */ Symbol("stats"); var PoolBase = class extends DispatcherBase { - constructor() { - super(); + constructor(opts) { + super(opts); this[kQueue] = new FixedQueue(); this[kClients] = []; this[kQueued] = 0; @@ -8455,7 +8182,6 @@ var require_pool = __commonJS({ allowH2, ...options } = {}) { - super(); if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError("invalid connections"); } @@ -8476,13 +8202,14 @@ var require_pool = __commonJS({ ...connect13 }); } + super(options); 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: connect13, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error2) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8673,9 +8400,8 @@ var require_agent = __commonJS({ function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client2(origin, opts) : new Pool(origin, opts); } - var Agent7 = class extends DispatcherBase { + var Agent9 = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect: connect13, ...options } = {}) { - super(); if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } @@ -8685,6 +8411,7 @@ var require_agent = __commonJS({ if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } + super(options); if (connect13 && typeof connect13 !== "function") { connect13 = { ...connect13 }; } @@ -8745,7 +8472,7 @@ var require_agent = __commonJS({ await Promise.all(destroyPromises); } }; - module2.exports = Agent7; + module2.exports = Agent9; } }); @@ -8755,7 +8482,7 @@ var require_proxy_agent = __commonJS({ "use strict"; var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); var { URL: URL10 } = require("node:url"); - var Agent7 = require_agent(); + var Agent9 = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); @@ -8827,7 +8554,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 URL10) && !opts.uri) { @@ -8870,7 +8597,7 @@ var require_proxy_agent = __commonJS({ return agentFactory(origin2, options); }; this[kClient] = clientFactory(url, { connect: connect13 }); - this[kAgent] = new Agent7({ + this[kAgent] = new Agent9({ ...opts, factory, connect: async (opts2, callback) => { @@ -8968,7 +8695,7 @@ var require_proxy_agent = __commonJS({ throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); } } - module2.exports = ProxyAgent2; + module2.exports = ProxyAgent3; } }); @@ -8978,8 +8705,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 Agent7 = require_agent(); + var ProxyAgent3 = require_proxy_agent(); + var Agent9 = require_agent(); var DEFAULT_PORTS3 = { "http:": 80, "https:": 443 @@ -8999,16 +8726,16 @@ var require_env_http_proxy_agent = __commonJS({ }); } const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; - this[kNoProxyAgent] = new Agent7(agentOpts); + this[kNoProxyAgent] = new Agent9(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]; } @@ -10849,13 +10576,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data: data3, headers, trailers, error: error2 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data: data3, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error2 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error2); + handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10893,19 +10620,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error2) { - if (error2 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error2; + throw error3; } } } else { @@ -11070,11 +10797,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error2) { - if (typeof error2 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11293,7 +11020,7 @@ var require_mock_agent = __commonJS({ "node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) { "use strict"; var { kClients } = require_symbols(); - var Agent7 = require_agent(); + var Agent9 = require_agent(); var { kAgent, kMockAgentSet, @@ -11320,7 +11047,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 Agent7(opts); + const agent = opts?.agent ? opts.agent : new Agent9(opts); this[kAgent] = agent; this[kClients] = agent[kClients]; this[kOptions] = buildMockOptions(opts); @@ -11424,9 +11151,9 @@ var require_global2 = __commonJS({ "use strict"; var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); - var Agent7 = require_agent(); + var Agent9 = require_agent(); if (getGlobalDispatcher() === void 0) { - setGlobalDispatcher(new Agent7()); + setGlobalDispatcher(new Agent9()); } function setGlobalDispatcher(agent) { if (!agent || typeof agent.dispatch !== "function") { @@ -12035,12 +11762,12 @@ var require_headers = __commonJS({ append(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); - const exists = this[kHeadersMap].get(lowercaseName); - if (exists) { + const exists2 = this[kHeadersMap].get(lowercaseName); + if (exists2) { const delimiter = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { - name: exists.name, - value: `${exists.value}${delimiter}${value}` + name: exists2.name, + value: `${exists2.value}${delimiter}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); @@ -12165,7 +11892,7 @@ var require_headers = __commonJS({ } } }; - var Headers2 = class _Headers { + var Headers3 = class _Headers { #guard; #headersList; constructor(init = void 0) { @@ -12315,13 +12042,13 @@ var require_headers = __commonJS({ o2.#headersList = list2; } }; - 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, @@ -12339,7 +12066,7 @@ var require_headers = __commonJS({ webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object") { const iterator = Reflect.get(V, Symbol.iterator); - if (!util.types.isProxy(V) && iterator === Headers2.prototype.entries) { + if (!util.types.isProxy(V) && iterator === Headers3.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { @@ -12360,7 +12087,7 @@ var require_headers = __commonJS({ fill, // for test. compareHeaderName, - Headers: Headers2, + Headers: Headers3, HeadersList, getHeadersGuard, setHeadersGuard, @@ -12374,7 +12101,7 @@ 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 nodeUtil = require("node:util"); @@ -12452,7 +12179,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; @@ -12696,7 +12423,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) { @@ -12816,7 +12543,7 @@ 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 nodeUtil = require("node:util"); @@ -13084,7 +12811,7 @@ var require_request2 = __commonJS({ requestFinalizer.register(ac, { signal, abort }, abort); } } - this[kHeaders] = new Headers2(kConstruct); + this[kHeaders] = new Headers3(kConstruct); setHeadersList(this[kHeaders], request.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { @@ -13373,7 +13100,7 @@ var require_request2 = __commonJS({ const request = new Request2(kConstruct); request[kState] = innerRequest; request[kSignal] = signal; - request[kHeaders] = new Headers2(kConstruct); + request[kHeaders] = new Headers3(kConstruct); setHeadersList(request[kHeaders], innerRequest.headersList); setHeadersGuard(request[kHeaders], guard); return request; @@ -13592,17 +13319,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error2) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error2) { - error2 = new DOMException("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error2; - this.connection?.destroy(error2); - this.emit("terminated", error2); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function handleFetchDone(response) { @@ -13698,12 +13425,12 @@ var require_fetch = __commonJS({ ); } var markResourceTiming = performance.markResourceTiming; - function abortFetch(p2, request, responseObject, error2) { + function abortFetch(p2, request, responseObject, error3) { if (p2) { - p2.reject(error2); + p2.reject(error3); } if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error2).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13715,7 +13442,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error2).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -14536,13 +14263,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error2) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error2); - fetchParams.controller.terminate(error2); - reject(error2); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, rawHeaders, socket) { if (status !== 101) { @@ -15005,8 +14732,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error2) { - fr[kError] = error2; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -15015,13 +14742,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error2) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error2; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -16411,10 +16138,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) { @@ -16427,7 +16154,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"); @@ -16441,7 +16168,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 []; @@ -16450,7 +16177,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) { @@ -17052,13 +16779,13 @@ var require_frame = __commonJS({ "use strict"; var { maxUnsigned16Bit } = require_constants5(); var BUFFER_SIZE = 16386; - var crypto3; + var crypto4; var buffer = null; var bufIdx = BUFFER_SIZE; try { - crypto3 = require("node:crypto"); + crypto4 = require("node:crypto"); } catch { - crypto3 = { + crypto4 = { // not full compatibility, but minimum. randomFillSync: function randomFillSync(buffer2, _offset2, _size) { for (let i5 = 0; i5 < buffer2.length; ++i5) { @@ -17071,7 +16798,7 @@ var require_frame = __commonJS({ function generateMask() { if (bufIdx === BUFFER_SIZE) { bufIdx = 0; - crypto3.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); + crypto4.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); } return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]; } @@ -17140,12 +16867,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 crypto3; + var crypto4; try { - crypto3 = require("node:crypto"); + crypto4 = require("node:crypto"); } catch { } function establishWebSocketConnection(url, protocols2, client, ws, onEstablish, options) { @@ -17162,10 +16889,10 @@ var require_connection = __commonJS({ redirect: "error" }); if (options.headers) { - const headersList = getHeadersList(new Headers2(options.headers)); + const headersList = getHeadersList(new Headers3(options.headers)); request.headersList = headersList; } - const keyValue = crypto3.randomBytes(16).toString("base64"); + const keyValue = crypto4.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols2) { @@ -17195,7 +16922,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto4.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -17293,11 +17020,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error2) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error2); + channels.socketError.publish(error3); } this.destroy(); } @@ -17318,31 +17045,26 @@ var require_permessage_deflate = __commonJS({ var tail = Buffer.from([0, 0, 255, 255]); var kBuffer = /* @__PURE__ */ Symbol("kBuffer"); var kLength = /* @__PURE__ */ Symbol("kLength"); - var kDefaultMaxDecompressedSize = 4 * 1024 * 1024; var PerMessageDeflate = class { /** @type {import('node:zlib').InflateRaw} */ #inflate; #options = {}; - /** @type {number} */ - #maxDecompressedSize; - /** @type {boolean} */ - #aborted = false; - /** @type {Function|null} */ - #currentCallback = null; + #maxPayloadSize = 0; /** * @param {Map} extensions - * @param {{ maxDecompressedMessageSize?: number }} [options] */ - constructor(extensions, options = {}) { + constructor(extensions, options) { this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); - this.#maxDecompressedSize = options.maxDecompressedMessageSize ?? kDefaultMaxDecompressedSize; + this.#maxPayloadSize = options.maxPayloadSize; } + /** + * Decompress a compressed payload. + * @param {Buffer} chunk Compressed data + * @param {boolean} fin Final fragment flag + * @param {Function} callback Callback function + */ decompress(chunk, fin, callback) { - if (this.#aborted) { - callback(new MessageSizeExceededError()); - return; - } if (!this.#inflate) { let windowBits = Z_DEFAULT_WINDOWBITS; if (this.#options.serverMaxWindowBits) { @@ -17361,20 +17083,11 @@ var require_permessage_deflate = __commonJS({ this.#inflate[kBuffer] = []; this.#inflate[kLength] = 0; this.#inflate.on("data", (data3) => { - if (this.#aborted) { - return; - } this.#inflate[kLength] += data3.length; - if (this.#inflate[kLength] > this.#maxDecompressedSize) { - this.#aborted = true; + if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { + callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); - this.#inflate.destroy(); this.#inflate = null; - if (this.#currentCallback) { - const cb = this.#currentCallback; - this.#currentCallback = null; - cb(new MessageSizeExceededError()); - } return; } this.#inflate[kBuffer].push(data3); @@ -17384,19 +17097,17 @@ var require_permessage_deflate = __commonJS({ callback(err); }); } - this.#currentCallback = callback; this.#inflate.write(chunk); if (fin) { this.#inflate.write(tail); } this.#inflate.flush(() => { - if (this.#aborted || !this.#inflate) { + if (!this.#inflate) { return; } const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); this.#inflate[kBuffer].length = 0; this.#inflate[kLength] = 0; - this.#currentCallback = null; callback(null, full); }); } @@ -17427,8 +17138,10 @@ var require_receiver = __commonJS({ var { WebsocketFrameSend } = require_frame(); var { closeWebSocketConnection } = require_connection(); var { PerMessageDeflate } = require_permessage_deflate(); + var { MessageSizeExceededError } = require_errors(); var ByteParser = class extends Writable { #buffers = []; + #fragmentsBytes = 0; #byteOffset = 0; #loop = false; #state = parserStates.INFO; @@ -17436,18 +17149,18 @@ var require_receiver = __commonJS({ #fragments = []; /** @type {Map} */ #extensions; - /** @type {{ maxDecompressedMessageSize?: number }} */ - #options; + /** @type {number} */ + #maxPayloadSize; /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxDecompressedMessageSize?: number }} [options] + * @param {{ maxPayloadSize?: number }} [options] */ constructor(ws, extensions, options = {}) { super(); this.ws = ws; this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; - this.#options = options; + this.#maxPayloadSize = options.maxPayloadSize ?? 0; if (this.#extensions.has("permessage-deflate")) { this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options)); } @@ -17462,6 +17175,13 @@ var require_receiver = __commonJS({ this.#loop = true; this.run(callback); } + #validatePayloadLength() { + if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, "Payload size exceeds maximum allowed size"); + return false; + } + return true; + } /** * Runs whenever a new chunk is received. * Callback is called whenever there are no more chunks buffering, @@ -17521,6 +17241,9 @@ var require_receiver = __commonJS({ if (payloadLength <= 125) { this.#info.payloadLength = payloadLength; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16; } else if (payloadLength === 127) { @@ -17541,6 +17264,9 @@ var require_receiver = __commonJS({ const buffer = this.consume(2); this.#info.payloadLength = buffer.readUInt16BE(0); this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback(); @@ -17554,6 +17280,9 @@ var require_receiver = __commonJS({ } this.#info.payloadLength = lower; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { return callback(); @@ -17564,32 +17293,41 @@ var require_receiver = __commonJS({ this.#state = parserStates.INFO; } else { if (!this.#info.compressed) { - this.#fragments.push(body); + this.writeFragments(body); + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, new MessageSizeExceededError().message); + return; + } if (!this.#info.fragmented && this.#info.fin) { - const fullMessage = Buffer.concat(this.#fragments); - websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage); - this.#fragments.length = 0; + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); } this.#state = parserStates.INFO; } else { - this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data3) => { - if (error2) { - failWebsocketConnection(this.ws, error2.message); - return; - } - this.#fragments.push(data3); - if (!this.#info.fin) { - this.#state = parserStates.INFO; + this.#extensions.get("permessage-deflate").decompress( + body, + this.#info.fin, + (error3, data3) => { + if (error3) { + failWebsocketConnection(this.ws, error3.message); + return; + } + this.writeFragments(data3); + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnection(this.ws, new MessageSizeExceededError().message); + return; + } + if (!this.#info.fin) { + this.#state = parserStates.INFO; + this.#loop = true; + this.run(callback); + return; + } + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); this.#loop = true; + this.#state = parserStates.INFO; this.run(callback); - return; } - websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments)); - this.#loop = true; - this.#state = parserStates.INFO; - this.#fragments.length = 0; - this.run(callback); - }); + ); this.#loop = false; break; } @@ -17632,6 +17370,21 @@ var require_receiver = __commonJS({ this.#byteOffset -= n3; return buffer; } + writeFragments(fragment) { + this.#fragmentsBytes += fragment.length; + this.#fragments.push(fragment); + } + consumeFragments() { + const fragments = this.#fragments; + if (fragments.length === 1) { + this.#fragmentsBytes = 0; + return fragments.shift(); + } + const output = Buffer.concat(fragments, this.#fragmentsBytes); + this.#fragments = []; + this.#fragmentsBytes = 0; + return output; + } parseCloseBody(data3) { assert4(data3.length !== 1); let code; @@ -17843,8 +17596,6 @@ var require_websocket = __commonJS({ #extensions = ""; /** @type {SendQueue} */ #sendQueue; - /** @type {{ maxDecompressedMessageSize?: number }} */ - #options; /** * @param {string} url * @param {string|string[]} protocols @@ -17888,9 +17639,6 @@ var require_websocket = __commonJS({ throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } this[kWebSocketURL] = new URL(urlRecord.href); - this.#options = { - maxDecompressedMessageSize: options.maxDecompressedMessageSize - }; const client = environmentSettingsObject.settingsObject; this[kController] = establishWebSocketConnection( urlRecord, @@ -18074,7 +17822,10 @@ var require_websocket = __commonJS({ */ #onConnectionEstablished(response, parsedExtensions) { this[kResponse] = response; - const parser = new ByteParser(this, parsedExtensions, this.#options); + const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize; + const parser = new ByteParser(this, parsedExtensions, { + maxPayloadSize + }); parser.on("drain", onParserDrain); parser.on("error", onParserError.bind(this)); response.socket.ws = this; @@ -18149,19 +17900,6 @@ var require_websocket = __commonJS({ { key: "headers", converter: webidl.nullableConverter(webidl.converters.HeadersInit) - }, - { - key: "maxDecompressedMessageSize", - converter: webidl.nullableConverter((V) => { - V = webidl.converters["unsigned long long"](V); - if (V <= 0) { - throw webidl.errors.exception({ - header: "WebSocket constructor", - message: "maxDecompressedMessageSize must be greater than 0" - }); - } - return V; - }) } ]); webidl.converters["DOMString or sequence or WebSocketInit"] = function(V) { @@ -18624,8 +18362,8 @@ var require_eventsource = __commonJS({ pipeline( response.body.stream, eventSourceStream, - (error2) => { - if (error2?.aborted === false) { + (error3) => { + if (error3?.aborted === false) { this.close(); this.dispatchEvent(new Event("error")); } @@ -18764,8 +18502,8 @@ var require_undici = __commonJS({ var Dispatcher = require_dispatcher(); var Pool = require_pool(); var BalancedPool = require_balanced_pool(); - var Agent7 = require_agent(); - var ProxyAgent2 = require_proxy_agent(); + var Agent9 = require_agent(); + var ProxyAgent3 = require_proxy_agent(); var EnvHttpProxyAgent = require_env_http_proxy_agent(); var RetryAgent = require_retry_agent(); var errors = require_errors(); @@ -18787,8 +18525,8 @@ var require_undici = __commonJS({ module2.exports.Client = Client2; module2.exports.Pool = Pool; module2.exports.BalancedPool = BalancedPool; - module2.exports.Agent = Agent7; - module2.exports.ProxyAgent = ProxyAgent2; + module2.exports.Agent = Agent9; + module2.exports.ProxyAgent = ProxyAgent3; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.RetryAgent = RetryAgent; module2.exports.RetryHandler = RetryHandler; @@ -18898,2695 +18636,6 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.HttpClient = exports2.HttpClientResponse = exports2.HttpClientError = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - exports2.getProxyUrl = getProxyUrl; - exports2.isHttps = isHttps; - var http5 = __importStar2(require("http")); - var https4 = __importStar2(require("https")); - var pm = __importStar2(require_proxy()); - var tunnel = __importStar2(require_tunnel2()); - var undici_1 = require_undici(); - 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 || (exports2.HttpCodes = HttpCodes = {})); - var Headers2; - (function(Headers3) { - Headers3["Accept"] = "accept"; - Headers3["ContentType"] = "content-type"; - })(Headers2 || (exports2.Headers = Headers2 = {})); - var MediaTypes; - (function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; - })(MediaTypes || (exports2.MediaTypes = MediaTypes = {})); - function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ""; - } - var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect - ]; - var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.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:"; - } - var HttpClient = class { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __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, data3, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data3, additionalHeaders || {}); - }); - } - patch(requestUrl, data3, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data3, additionalHeaders || {}); - }); - } - put(requestUrl, data3, additionalHeaders) { - return __awaiter2(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data3, 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_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data3 = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data3, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data3 = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data3, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { - const data3 = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data3, 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, data3, 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 info5 = 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(info5, data3); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info5, data3); - } else { - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes.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]; - } - } - } - info5 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info5, data3); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info5, data3) { - 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(info5, data3, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info5, data3, onResult) { - if (typeof data3 === "string") { - if (!info5.options.headers) { - info5.options.headers = {}; - } - info5.options.headers["Content-Length"] = Buffer.byteLength(data3, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info5.httpModule.request(info5.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: ${info5.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data3 && typeof data3 === "string") { - req.write(data3, "utf8"); - } - if (data3 && typeof data3 !== "string") { - data3.on("close", function() { - req.end(); - }); - data3.pipe(req); - } else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info5 = {}; - info5.parsedUrl = requestUrl; - const usingSsl = info5.parsedUrl.protocol === "https:"; - info5.httpModule = usingSsl ? https4 : http5; - const defaultPort = usingSsl ? 443 : 80; - info5.options = {}; - info5.options.host = info5.parsedUrl.hostname; - info5.options.port = info5.parsedUrl.port ? parseInt(info5.parsedUrl.port) : defaultPort; - info5.options.path = (info5.parsedUrl.pathname || "") + (info5.parsedUrl.search || ""); - info5.options.method = method; - info5.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info5.options.headers["user-agent"] = this.userAgent; - } - info5.options.agent = this._getAgent(info5.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info5.options); - } - } - return info5; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - /** - * 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. - */ - _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; - } - /** - * 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]). - */ - _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 = pm.getProxyUrl(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 || http5.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 ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https4.Agent(options) : new http5.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 undici_1.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(userAgent) { - const baseUserAgent = userAgent || "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 __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)); - }); - } - _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 === HttpCodes.NotFound) { - resolve(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a5 = new Date(value); - if (!isNaN(a5.valueOf())) { - return a5; - } - } - 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); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c5, k5) => (c5[k5.toLowerCase()] = obj[k5], c5), {}); - } -}); - -// node_modules/@actions/http-client/lib/auth.js -var require_auth = __commonJS({ - "node_modules/@actions/http-client/lib/auth.js"(exports2) { - "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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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; - } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); - } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; - } - // 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"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; - } - // 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")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@actions/core/lib/oidc-utils.js -var require_oidc_utils = __commonJS({ - "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { - "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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.OidcClient = void 0; - var http_client_1 = require_lib(); - var auth_1 = require_auth(); - var core_1 = require_core(); - var OidcClient = 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) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2; - const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error2) => { - throw new Error(`Failed to get ID Token. - - Error Code : ${error2.statusCode} - - Error Message: ${error2.message}`); - }); - const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.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 (error2) { - throw new Error(`Error message: ${error2.message}`); - } - }); - } - }; - exports2.OidcClient = OidcClient; - } -}); - -// node_modules/@actions/core/lib/summary.js -var require_summary = __commonJS({ - "node_modules/@actions/core/lib/summary.js"(exports2) { - "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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.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, appendFile, writeFile } = 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 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 __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.`); - } - try { - yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a2) { - 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(tag2, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag2}${htmlAttrs}>`; - } - return `<${tag2}${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 __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 ? 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 __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 tag2 = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag2, 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: data3, colspan, rowspan } = cell; - const tag2 = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag2, data3, 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 tag2 = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag2) ? tag2 : "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(); - exports2.markdownSummary = _summary; - exports2.summary = _summary; - } -}); - -// node_modules/@actions/core/lib/path-utils.js -var require_path_utils = __commonJS({ - "node_modules/@actions/core/lib/path-utils.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toPosixPath = toPosixPath; - exports2.toWin32Path = toWin32Path; - exports2.toPlatformPath = toPlatformPath; - var path3 = __importStar2(require("path")); - function toPosixPath(pth) { - return pth.replace(/[\\]/g, "/"); - } - function toWin32Path(pth) { - return pth.replace(/[/]/g, "\\"); - } - function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path3.sep); - } - } -}); - -// 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 __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a2; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - exports2.readlink = readlink; - exports2.exists = exists; - exports2.isDirectory = isDirectory; - exports2.isRooted = isRooted; - exports2.tryGetExecutablePath = tryGetExecutablePath; - exports2.getCmdPath = getCmdPath; - var fs3 = __importStar2(require("fs")); - var path3 = __importStar2(require("path")); - _a2 = fs3.promises, exports2.chmod = _a2.chmod, exports2.copyFile = _a2.copyFile, exports2.lstat = _a2.lstat, exports2.mkdir = _a2.mkdir, exports2.open = _a2.open, exports2.readdir = _a2.readdir, exports2.rename = _a2.rename, exports2.rm = _a2.rm, exports2.rmdir = _a2.rmdir, exports2.stat = _a2.stat, exports2.symlink = _a2.symlink, exports2.unlink = _a2.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs3.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs3.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - try { - yield (0, exports2.stat)(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; - } - return true; - }); - } - function isDirectory(fsPath_1) { - return __awaiter2(this, arguments, void 0, function* (fsPath, useStat = false) { - const stats = useStat ? yield (0, exports2.stat)(fsPath) : yield (0, exports2.lstat)(fsPath); - return stats.isDirectory(); - }); - } - function isRooted(p2) { - p2 = normalizeSeparators(p2); - if (!p2) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports2.IS_WINDOWS) { - return p2.startsWith("\\") || /^[A-Z]:/i.test(p2); - } - return p2.startsWith("/"); - } - function tryGetExecutablePath(filePath, extensions) { - return __awaiter2(this, void 0, void 0, function* () { - let stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path3.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; - try { - stats = yield (0, exports2.stat)(filePath); - } catch (err) { - if (err.code !== "ENOENT") { - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - 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 (0, 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 { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - } - return ""; - }); - } - function normalizeSeparators(p2) { - p2 = p2 || ""; - if (exports2.IS_WINDOWS) { - p2 = p2.replace(/\//g, "\\"); - return p2.replace(/\\\\+/g, "\\"); - } - return p2.replace(/\/\/+/g, "/"); - } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); - } - function getCmdPath() { - var _a3; - return (_a3 = process.env["COMSPEC"]) !== null && _a3 !== void 0 ? _a3 : `cmd.exe`; - } - } -}); - -// node_modules/@actions/io/lib/io.js -var require_io = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.cp = cp; - exports2.mv = mv; - exports2.rmRF = rmRF; - exports2.mkdirP = mkdirP; - exports2.which = which; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path3 = __importStar2(require("path")); - var ioUtil = __importStar2(require_io_util()); - function cp(source_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { - 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}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path3.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { - 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); - } else { - throw new Error("Destination already exists"); - } - } - } - yield mkdirP(path3.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - 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 { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 - }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); - } - }); - } - function mkdirP(fsPath) { - return __awaiter2(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which(tool, check) { - return __awaiter2(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ""; - }); - } - 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 p2 of process.env.PATH.split(path3.delimiter)) { - if (p2) { - directories.push(p2); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } - } - return matches; - }); - } - 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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(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 (e5) { - if (e5.code === "EPERM") { - yield ioUtil.chmod(destFile, "0666"); - yield ioUtil.unlink(destFile); - } - } - 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); - } - }); - } - } -}); - -// node_modules/@actions/exec/lib/toolrunner.js -var require_toolrunner = __commonJS({ - "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.ToolRunner = void 0; - exports2.argStringToArray = argStringToArray; - var os3 = __importStar2(require("os")); - var events = __importStar2(require("events")); - var child = __importStar2(require("child_process")); - var path3 = __importStar2(require("path")); - var io = __importStar2(require_io()); - var ioUtil = __importStar2(require_io_util()); - var timers_1 = require("timers"); - var IS_WINDOWS = process.platform === "win32"; - var ToolRunner = 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_WINDOWS) { - if (this._isCmdFile()) { - cmd += toolPath; - for (const a5 of args) { - cmd += ` ${a5}`; - } - } else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a5 of args) { - cmd += ` ${a5}`; - } - } else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a5 of args) { - cmd += ` ${this._windowsQuoteCmdArg(a5)}`; - } - } - } else { - cmd += toolPath; - for (const a5 of args) { - cmd += ` ${a5}`; - } - } - return cmd; - } - _processLineBuffer(data3, strBuffer, onLine) { - try { - let s = strBuffer + data3.toString(); - let n3 = s.indexOf(os3.EOL); - while (n3 > -1) { - const line = s.substring(0, n3); - onLine(line); - s = s.substring(n3 + os3.EOL.length); - n3 = s.indexOf(os3.EOL); - } - return s; - } catch (err) { - this._debug(`error processing line. Failed with error ${err}`); - return ""; - } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env["COMSPEC"] || "cmd.exe"; - } - } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a5 of this.args) { - argline += " "; - argline += options.windowsVerbatimArguments ? a5 : this._windowsQuoteCmdArg(a5); - } - argline += '"'; - return [argline]; - } - } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); - } - _windowsQuoteCmdArg(arg) { - 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; - } - let reverse = '"'; - let quoteHit = true; - for (let i5 = arg.length; i5 > 0; i5--) { - reverse += arg[i5 - 1]; - if (quoteHit && arg[i5 - 1] === "\\") { - reverse += "\\"; - } else if (arg[i5 - 1] === '"') { - quoteHit = true; - reverse += '"'; - } else { - quoteHit = 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 i5 = arg.length; i5 > 0; i5--) { - reverse += arg[i5 - 1]; - if (quoteHit && arg[i5 - 1] === "\\") { - reverse += "\\"; - } else if (arg[i5 - 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; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter2(this, void 0, void 0, function* () { - if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && 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) + os3.EOL); - } - const state2 = new ExecState(optionsNonNull, this.toolPath); - state2.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", (data3) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data3); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data3); - } - stdbuffer = this._processLineBuffer(data3, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - let errbuffer = ""; - if (cp.stderr) { - cp.stderr.on("data", (data3) => { - state2.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data3); - } - if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data3); - } - errbuffer = this._processLineBuffer(data3, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on("error", (err) => { - state2.processError = err.message; - state2.processExited = true; - state2.processClosed = true; - state2.CheckComplete(); - }); - cp.on("exit", (code) => { - state2.processExitCode = code; - state2.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state2.CheckComplete(); - }); - cp.on("close", (code) => { - state2.processExitCode = code; - state2.processExited = true; - state2.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state2.CheckComplete(); - }); - state2.on("done", (error2, exitCode) => { - if (stdbuffer.length > 0) { - this.emit("stdline", stdbuffer); - } - if (errbuffer.length > 0) { - this.emit("errline", errbuffer); - } - cp.removeAllListeners(); - if (error2) { - reject(error2); - } 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 = ToolRunner; - function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ""; - function append(c5) { - if (escaped && c5 !== '"') { - arg += "\\"; - } - arg += c5; - escaped = false; - } - for (let i5 = 0; i5 < argString.length; i5++) { - const c5 = argString.charAt(i5); - if (c5 === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } else { - append(c5); - } - continue; - } - if (c5 === "\\" && escaped) { - append(c5); - continue; - } - if (c5 === "\\" && inQuotes) { - escaped = true; - continue; - } - if (c5 === " " && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ""; - } - continue; - } - append(c5); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; - } - 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"); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } else if (this.processExited) { - this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit("debug", message); - } - _setResult() { - let error2; - if (this.processExited) { - if (this.processError) { - error2 = 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) { - error2 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } else if (this.processStderr && this.options.failOnStdErr) { - error2 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit("done", error2, this.processExitCode); - } - static HandleTimeout(state2) { - if (state2.done) { - return; - } - if (!state2.processClosed && state2.processExited) { - const message = `The STDIO streams did not close within ${state2.delay / 1e3} seconds of the exit event from process '${state2.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state2._debug(message); - } - state2._setResult(); - } - }; - } -}); - -// node_modules/@actions/exec/lib/exec.js -var require_exec = __commonJS({ - "node_modules/@actions/exec/lib/exec.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.exec = exec; - exports2.getExecOutput = getExecOutput; - var string_decoder_1 = require("string_decoder"); - var tr = __importStar2(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(); - }); - } - function getExecOutput(commandLine, args, options) { - return __awaiter2(this, void 0, void 0, function* () { - var _a2, _b; - let stdout = ""; - let stderr = ""; - const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); - const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); - const originalStdoutListener = (_a2 = options === null || options === void 0 ? void 0 : options.listeners) === null || _a2 === void 0 ? void 0 : _a2.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data3) => { - stderr += stderrDecoder.write(data3); - if (originalStdErrListener) { - originalStdErrListener(data3); - } - }; - const stdOutListener = (data3) => { - stdout += stdoutDecoder.write(data3); - if (originalStdoutListener) { - originalStdoutListener(data3); - } - }; - 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 - }; - }); - } - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; - exports2.getDetails = getDetails; - var os_1 = __importDefault2(require("os")); - var exec = __importStar2(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 _a2, _b, _c5, _d; - const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a2 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a2 === void 0 ? void 0 : _a2[1]) !== null && _b !== void 0 ? _b : ""; - const name = (_d = (_c5 = stdout.match(/ProductName:\s*(.+)/)) === null || _c5 === void 0 ? void 0 : _c5[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 - }); - }); - } - } -}); - -// node_modules/@actions/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m3, k5); - if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m3[k5]; - } }; - } - Object.defineProperty(o2, k22, desc); - }) : (function(o2, m3, k5, k22) { - if (k22 === void 0) k22 = k5; - o2[k22] = m3[k5]; - })); - var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - }) : function(o2, v) { - o2["default"] = v; - }); - var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys2 = function(o2) { - ownKeys2 = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; - return ar; - }; - return ownKeys2(o2); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); - } - __setModuleDefault2(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 (e5) { - reject(e5); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e5) { - reject(e5); - } - } - 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.ExitCode = void 0; - exports2.exportVariable = exportVariable3; - exports2.setSecret = setSecret2; - exports2.addPath = addPath; - exports2.getInput = getInput3; - exports2.getMultilineInput = getMultilineInput2; - exports2.getBooleanInput = getBooleanInput2; - exports2.setOutput = setOutput2; - exports2.setCommandEcho = setCommandEcho; - exports2.setFailed = setFailed2; - exports2.isDebug = isDebug; - exports2.debug = debug19; - exports2.error = error2; - exports2.warning = warning; - exports2.notice = notice2; - exports2.info = info5; - exports2.startGroup = startGroup; - exports2.endGroup = endGroup; - exports2.group = group; - exports2.saveState = saveState; - exports2.getState = getState; - exports2.getIDToken = getIDToken2; - var command_1 = require_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os3 = __importStar2(require("os")); - var path3 = __importStar2(require("path")); - var oidc_utils_1 = require_oidc_utils(); - var ExitCode; - (function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; - })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable3(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); - } - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - function addPath(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"]}`; - } - function getInput3(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 (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); - } - function getMultilineInput2(name, options) { - const inputs = getInput3(name, options).split("\n").filter((x) => x !== ""); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map((input) => input.trim()); - } - function getBooleanInput2(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput3(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - 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\``); - } - function setOutput2(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(os3.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - function setFailed2(message) { - process.exitCode = ExitCode.Failure; - error2(message); - } - function isDebug() { - return process.env["RUNNER_DEBUG"] === "1"; - } - function debug19(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - function error2(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function warning(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function notice2(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - function info5(message) { - process.stdout.write(message + os3.EOL); - } - function startGroup(name) { - (0, command_1.issue)("group", name); - } - function endGroup() { - (0, command_1.issue)("endgroup"); - } - function group(name, fn) { - return __awaiter2(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } finally { - endGroup(); - } - return result; - }); - } - 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)); - } - function getState(name) { - return process.env[`STATE_${name}`] || ""; - } - function getIDToken2(aud) { - return __awaiter2(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - 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 = __importStar2(require_platform()); - } -}); - // node_modules/@smithy/types/dist-cjs/index.js var require_dist_cjs = __commonJS({ "node_modules/@smithy/types/dist-cjs/index.js"(exports2) { @@ -21895,7 +18944,7 @@ var require_dist_cjs4 = __commonJS({ metadata: $metadata }); return response; - } catch (error2) { + } catch (error3) { const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context; const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; @@ -21903,10 +18952,10 @@ var require_dist_cjs4 = __commonJS({ clientName, commandName, input: inputFilterSensitiveLog(args.input), - error: error2, - metadata: error2.$metadata + error: error3, + metadata: error3.$metadata }); - throw error2; + throw error3; } }; var loggerMiddlewareOptions = { @@ -22277,8 +19326,8 @@ var init_httpSigningMiddleware = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { import_protocol_http = __toESM(require_dist_cjs2()); import_util_middleware2 = __toESM(require_dist_cjs6()); - defaultErrorHandler = (signingProperties) => (error2) => { - throw error2; + defaultErrorHandler = (signingProperties) => (error3) => { + throw error3; }; defaultSuccessHandler = (httpResponse, signingProperties) => { }; @@ -22649,8 +19698,8 @@ var require_createChecksumStream_browser = __commonJS({ const digest = await checksum.digest(); const received = encoder(digest); if (expectedChecksum !== received) { - const error2 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); - controller.error(error2); + const error3 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); + controller.error(error3); } else { controller.terminate(); } @@ -23187,12 +20236,12 @@ var require_dist_cjs13 = __commonJS({ return timing.setTimeout(() => { let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; if (throwOnRequestTimeout) { - const error2 = Object.assign(new Error(msg), { + const error3 = Object.assign(new Error(msg), { name: "TimeoutError", code: "ETIMEDOUT" }); - req.destroy(error2); - reject(error2); + req.destroy(error3); + reject(error3); } else { msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; logger2?.warn?.(msg); @@ -23491,9 +20540,9 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf socketAcquisitionWarningTimeout, throwOnRequestTimeout, httpAgentProvider: async () => { - const { Agent: Agent7, request } = await import("node:http"); + const { Agent: Agent9, request } = await import("node:http"); hRequest = request; - hAgent = Agent7; + hAgent = Agent9; if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") { this.externalAgent = true; return httpAgent; @@ -24539,17 +21588,17 @@ var init_schemaDeserializationMiddleware = __esm({ response, output: parsed }; - } catch (error2) { - Object.defineProperty(error2, "$response", { + } catch (error3) { + Object.defineProperty(error3, "$response", { value: response, enumerable: false, writable: false, configurable: false }); - if (!("$metadata" in error2)) { + if (!("$metadata" in error3)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; try { - error2.message += "\n " + hint; + error3.message += "\n " + hint; } catch (e5) { if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { console.warn(hint); @@ -24557,16 +21606,16 @@ var init_schemaDeserializationMiddleware = __esm({ context.logger?.warn?.(hint); } } - if (typeof error2.$responseBodyText !== "undefined") { - if (error2.$response) { - error2.$response.body = error2.$responseBodyText; + if (typeof error3.$responseBodyText !== "undefined") { + if (error3.$response) { + error3.$response.body = error3.$responseBodyText; } } try { if (import_protocol_http2.HttpResponse.isInstance(response)) { const { headers = {} } = response; const headerEntries = Object.entries(headers); - error2.$metadata = { + error3.$metadata = { httpStatusCode: response.statusCode, requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), @@ -24576,7 +21625,7 @@ var init_schemaDeserializationMiddleware = __esm({ } catch (e5) { } } - throw error2; + throw error3; } }; findHeader = (pattern, headers) => { @@ -24849,7 +21898,7 @@ var init_StructureSchema = __esm({ }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js -var ErrorSchema, error; +var ErrorSchema, error2; var init_ErrorSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { init_Schema(); @@ -24859,7 +21908,7 @@ var init_ErrorSchema = __esm({ ctor; symbol = _ErrorSchema.symbol; }; - error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { + error2 = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { name, namespace, traits, @@ -25353,7 +22402,7 @@ __export(schema_exports, { TypeRegistry: () => TypeRegistry, deref: () => deref, deserializerMiddlewareOption: () => deserializerMiddlewareOption, - error: () => error, + error: () => error2, getSchemaSerdePlugin: () => getSchemaSerdePlugin, isStaticSchema: () => isStaticSchema, list: () => list, @@ -25833,7 +22882,7 @@ __export(tslib_es6_exports, { __asyncGenerator: () => __asyncGenerator, __asyncValues: () => __asyncValues, __await: () => __await, - __awaiter: () => __awaiter, + __awaiter: () => __awaiter6, __classPrivateFieldGet: () => __classPrivateFieldGet, __classPrivateFieldIn: () => __classPrivateFieldIn, __classPrivateFieldSet: () => __classPrivateFieldSet, @@ -25941,7 +22990,7 @@ function __setFunctionName(f5, name, prefix) { function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } -function __awaiter(thisArg, _arguments, P, generator) { +function __awaiter6(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); @@ -26057,8 +23106,8 @@ function __read(o2, n3) { var i5 = m3.call(o2), r5, ar = [], e5; try { while ((n3 === void 0 || n3-- > 0) && !(r5 = i5.next()).done) ar.push(r5.value); - } catch (error2) { - e5 = { error: error2 }; + } catch (error3) { + e5 = { error: error3 }; } finally { try { if (r5 && !r5.done && (m3 = i5["return"])) m3.call(i5); @@ -26308,9 +23357,9 @@ var init_tslib_es6 = __esm({ }; return ownKeys(o2); }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) { var e5 = new Error(message); - return e5.name = "SuppressedError", e5.error = error2, e5.suppressed = suppressed, e5; + return e5.name = "SuppressedError", e5.error = error3, e5.suppressed = suppressed, e5; }; tslib_es6_default = { __extends, @@ -26323,7 +23372,7 @@ var init_tslib_es6 = __esm({ __propKey, __setFunctionName, __metadata, - __awaiter, + __awaiter: __awaiter6, __generator, __createBinding, __exportStar, @@ -26365,11 +23414,11 @@ var require_randomUUID = __commonJS({ var require_dist_cjs19 = __commonJS({ "node_modules/@smithy/uuid/dist-cjs/index.js"(exports2) { "use strict"; - var randomUUID = require_randomUUID(); + var randomUUID2 = require_randomUUID(); var decimalToHex = Array.from({ length: 256 }, (_, i5) => i5.toString(16).padStart(2, "0")); var v4 = () => { - if (randomUUID.randomUUID) { - return randomUUID.randomUUID(); + if (randomUUID2.randomUUID) { + return randomUUID2.randomUUID(); } const rnds = new Uint8Array(16); crypto.getRandomValues(rnds); @@ -28299,7 +25348,7 @@ var require_dist_cjs20 = __commonJS({ return url; } return new URL(value); - } catch (error2) { + } catch (error3) { return null; } })(); @@ -28491,9 +25540,9 @@ var require_dist_cjs20 = __commonJS({ if (typeof expression === "string") { try { return new URL(expression); - } catch (error2) { - console.error(`Failed to construct URL with ${expression}`, error2); - throw error2; + } catch (error3) { + console.error(`Failed to construct URL with ${expression}`, error3); + throw error3; } } throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); @@ -28580,7 +25629,7 @@ var require_dist_cjs20 = __commonJS({ return endpointToReturn; }; var evaluateErrorRule = (errorRule, options) => { - const { conditions, error: error2 } = errorRule; + const { conditions, error: error3 } = errorRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; @@ -28589,7 +25638,7 @@ var require_dist_cjs20 = __commonJS({ ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } } : options; - throw new EndpointError(evaluateExpression(error2, "Error", errorRuleOptions)); + throw new EndpointError(evaluateExpression(error3, "Error", errorRuleOptions)); }; var evaluateRules = (rules, options) => { for (const rule of rules) { @@ -29063,15 +26112,24 @@ var init_emitWarningIfUnsupportedVersion = __esm({ warningEmitted: false }; emitWarningIfUnsupportedVersion = (version) => { - if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) { - state.warningEmitted = true; - process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js ${version} in January 2026. + if (version && !state.warningEmitted) { + if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") { + state.warningEmitted = true; + return; + } + const userMajorVersion = parseInt(version.substring(1, version.indexOf("."))); + const vv = 22; + if (userMajorVersion < vv) { + state.warningEmitted = true; + process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3) +versions published after the first week of January 2027 +will require node >=${vv}. You are running node ${version}. -To continue receiving updates to AWS services, bug fixes, and security -updates please upgrade to a supported Node.js LTS version. +To continue receiving updates to AWS services, bug fixes, +and security updates please upgrade to node >=${vv}. More information can be found at: https://a.co/c895JFp`); + } } }; } @@ -29144,10 +26202,10 @@ var require_dist_cjs22 = __commonJS({ var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; - var isRetryableByTrait = (error2) => error2?.$retryable !== void 0; - var isClockSkewError = (error2) => CLOCK_SKEW_ERROR_CODES.includes(error2.name); - var isClockSkewCorrectedError = (error2) => error2.$metadata?.clockSkewCorrected; - var isBrowserNetworkError = (error2) => { + var isRetryableByTrait = (error3) => error3?.$retryable !== void 0; + var isClockSkewError = (error3) => CLOCK_SKEW_ERROR_CODES.includes(error3.name); + var isClockSkewCorrectedError = (error3) => error3.$metadata?.clockSkewCorrected; + var isBrowserNetworkError = (error3) => { const errorMessages = /* @__PURE__ */ new Set([ "Failed to fetch", "NetworkError when attempting to fetch resource", @@ -29155,26 +26213,26 @@ var require_dist_cjs22 = __commonJS({ "Load failed", "Network request failed" ]); - const isValid = error2 && error2 instanceof TypeError; + const isValid = error3 && error3 instanceof TypeError; if (!isValid) { return false; } - return errorMessages.has(error2.message); + return errorMessages.has(error3.message); }; - var isThrottlingError = (error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true; - var isTransientError = (error2, depth = 0) => isRetryableByTrait(error2) || isClockSkewCorrectedError(error2) || error2.name === "InvalidSignatureException" && error2.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error2?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error2) || isNodeJsHttp2TransientError(error2) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1); - var isServerError = (error2) => { - if (error2.$metadata?.httpStatusCode !== void 0) { - const statusCode = error2.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) { + var isThrottlingError = (error3) => error3.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error3.name) || error3.$retryable?.throttling == true; + var isTransientError = (error3, depth = 0) => isRetryableByTrait(error3) || isClockSkewCorrectedError(error3) || error3.name === "InvalidSignatureException" && error3.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error3.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error3?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error3?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error3.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error3) || isNodeJsHttp2TransientError(error3) || error3.cause !== void 0 && depth <= 10 && isTransientError(error3.cause, depth + 1); + var isServerError = (error3) => { + if (error3.$metadata?.httpStatusCode !== void 0) { + const statusCode = error3.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error3)) { return true; } return false; } return false; }; - function isNodeJsHttp2TransientError(error2) { - return error2.code === "ERR_HTTP2_STREAM_ERROR" && error2.message.includes("NGHTTP2_REFUSED_STREAM"); + function isNodeJsHttp2TransientError(error3) { + return error3.code === "ERR_HTTP2_STREAM_ERROR" && error3.message.includes("NGHTTP2_REFUSED_STREAM"); } exports2.isBrowserNetworkError = isBrowserNetworkError; exports2.isClockSkewCorrectedError = isClockSkewCorrectedError; @@ -29258,9 +26316,10 @@ var require_dist_cjs23 = __commonJS({ return; } this.refillTokenBucket(); - if (amount > this.availableTokens) { + while (amount > this.availableTokens) { const delay = (amount - this.availableTokens) / this.fillRate * 1e3; await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay)); + this.refillTokenBucket(); } this.availableTokens = this.availableTokens - amount; } @@ -29435,7 +26494,7 @@ var require_dist_cjs23 = __commonJS({ async getMaxAttempts() { try { return await this.maxAttemptsProvider(); - } catch (error2) { + } catch (error3) { console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); return DEFAULT_MAX_ATTEMPTS; } @@ -29467,12 +26526,15 @@ var require_dist_cjs23 = __commonJS({ }) : new StandardRetryStrategy(maxAttemptsProvider); } async acquireInitialRetryToken(retryTokenScope) { + const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + return token; } async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + await this.rateLimiter.getSendToken(); + return token; } recordSuccess(token) { this.rateLimiter.updateClientSendingRate({}); @@ -29573,7 +26635,7 @@ var init_client = __esm({ var require_dist_cjs24 = __commonJS({ "node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js"(exports2) { "use strict"; - var core5 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilEndpoints = require_dist_cjs21(); var protocolHttp = require_dist_cjs2(); var client = (init_client(), __toCommonJS(client_exports)); @@ -29586,7 +26648,7 @@ var require_dist_cjs24 = __commonJS({ return typeof appId === "string" && appId.length <= 50; } function resolveUserAgentConfig5(input) { - const normalizedAppIdProvider = core5.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); + const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); const { customUserAgent } = input; return Object.assign(input, { customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, @@ -29974,7 +27036,7 @@ var require_dist_cjs27 = __commonJS({ ...request.headers, [CONTENT_LENGTH_HEADER]: String(length) }; - } catch (error2) { + } catch (error3) { } } } @@ -30023,8 +27085,8 @@ var require_dist_cjs28 = __commonJS({ Object.setPrototypeOf(this, _ProviderError.prototype); logger2?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); } - static from(error2, options = true) { - return Object.assign(new this(error2.message, options), error2); + static from(error3, options = true) { + return Object.assign(new this(error3.message, options), error3); } }; var CredentialsProviderError = class _CredentialsProviderError extends ProviderError2 { @@ -30381,11 +27443,11 @@ var require_dist_cjs30 = __commonJS({ var sharedIniFileLoader = require_dist_cjs29(); function getSelectorName(functionString) { try { - const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); - constants.delete("CONFIG"); - constants.delete("CONFIG_PREFIX_SEPARATOR"); - constants.delete("ENV"); - return [...constants].join(", "); + const constants3 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); + constants3.delete("CONFIG"); + constants3.delete("CONFIG_PREFIX_SEPARATOR"); + constants3.delete("ENV"); + return [...constants3].join(", "); } catch (e5) { return functionString; } @@ -30497,17 +27559,17 @@ var require_dist_cjs31 = __commonJS({ response, output: parsed }; - } catch (error2) { - Object.defineProperty(error2, "$response", { + } catch (error3) { + Object.defineProperty(error3, "$response", { value: response, enumerable: false, writable: false, configurable: false }); - if (!("$metadata" in error2)) { + if (!("$metadata" in error3)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; try { - error2.message += "\n " + hint; + error3.message += "\n " + hint; } catch (e5) { if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { console.warn(hint); @@ -30515,16 +27577,16 @@ var require_dist_cjs31 = __commonJS({ context.logger?.warn?.(hint); } } - if (typeof error2.$responseBodyText !== "undefined") { - if (error2.$response) { - error2.$response.body = error2.$responseBodyText; + if (typeof error3.$responseBodyText !== "undefined") { + if (error3.$response) { + error3.$response.body = error3.$responseBodyText; } } try { if (protocolHttp.HttpResponse.isInstance(response)) { const { headers = {} } = response; const headerEntries = Object.entries(headers); - error2.$metadata = { + error3.$metadata = { httpStatusCode: response.statusCode, requestId: findHeader2(/^x-[\w-]+-request-?id$/, headerEntries), extendedRequestId: findHeader2(/^x-[\w-]+-id-2$/, headerEntries), @@ -30534,7 +27596,7 @@ var require_dist_cjs31 = __commonJS({ } catch (e5) { } } - throw error2; + throw error3; } }; var findHeader2 = (pattern, headers) => { @@ -30586,7 +27648,7 @@ var require_dist_cjs31 = __commonJS({ var require_dist_cjs32 = __commonJS({ "node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2) { "use strict"; - var core5 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilMiddleware = require_dist_cjs6(); var getEndpointFromConfig = require_getEndpointFromConfig(); var urlParser = require_dist_cjs18(); @@ -30749,7 +27811,7 @@ var require_dist_cjs32 = __commonJS({ var endpointMiddleware = ({ config, instructions }) => { return (next, context) => async (args) => { if (config.isCustomEndpoint) { - core5.setFeature(context, "ENDPOINT_OVERRIDE", "N"); + core.setFeature(context, "ENDPOINT_OVERRIDE", "N"); } const endpoint = await getEndpointFromInstructions(args.input, { getEndpointParameterInstructions() { @@ -30923,7 +27985,7 @@ var require_dist_cjs33 = __commonJS({ }); return expandedMiddlewareList; }; - const getMiddlewareList = (debug19 = false) => { + const getMiddlewareList = (debug17 = false) => { const normalizedAbsoluteEntries = []; const normalizedRelativeEntries = []; const normalizedEntriesNameMap = {}; @@ -30953,7 +28015,7 @@ var require_dist_cjs33 = __commonJS({ if (entry.toMiddleware) { const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; if (toMiddleware === void 0) { - if (debug19) { + if (debug17) { return; } throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`); @@ -31193,7 +28255,7 @@ var require_dist_cjs34 = __commonJS({ } return data3; } - var Command = class { + var Command2 = class { middlewareStack = middlewareStack.constructStack(); schema; static classBuilder() { @@ -31291,7 +28353,7 @@ var require_dist_cjs34 = __commonJS({ build() { const closure = this; let CommandRef; - return CommandRef = class extends Command { + return CommandRef = class extends Command2 { input; static getEndpointParameterInstructions() { return closure._ep; @@ -31684,7 +28746,7 @@ var require_dist_cjs34 = __commonJS({ exports2.extendedEncodeURIComponent = protocols2.extendedEncodeURIComponent; exports2.resolvedPath = protocols2.resolvedPath; exports2.Client = Client2; - exports2.Command = Command; + exports2.Command = Command2; exports2.NoOpLogger = NoOpLogger5; exports2.SENSITIVE_STRING = SENSITIVE_STRING; exports2.ServiceException = ServiceException; @@ -31740,14 +28802,14 @@ var require_dist_cjs35 = __commonJS({ var smithyClient = require_dist_cjs34(); var isStreamingPayload = require_isStreamingPayload(); var serde = (init_serde(), __toCommonJS(serde_exports)); - var asSdkError = (error2) => { - if (error2 instanceof Error) - return error2; - if (error2 instanceof Object) - return Object.assign(new Error(), error2); - if (typeof error2 === "string") - return new Error(error2); - return new Error(`AWS SDK error wrapper for ${error2}`); + var asSdkError = (error3) => { + if (error3 instanceof Error) + return error3; + if (error3 instanceof Object) + return Object.assign(new Error(), error3); + if (typeof error3 === "string") + return new Error(error3); + return new Error(`AWS SDK error wrapper for ${error3}`); }; var getDefaultRetryQuota = (initialRetryTokens, options) => { const MAX_CAPACITY = initialRetryTokens; @@ -31755,13 +28817,13 @@ var require_dist_cjs35 = __commonJS({ const retryCost = utilRetry.RETRY_COST; const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; let availableCapacity = initialRetryTokens; - const getCapacityAmount = (error2) => error2.name === "TimeoutError" ? timeoutRetryCost : retryCost; - const hasRetryTokens = (error2) => getCapacityAmount(error2) <= availableCapacity; - const retrieveRetryTokens = (error2) => { - if (!hasRetryTokens(error2)) { + const getCapacityAmount = (error3) => error3.name === "TimeoutError" ? timeoutRetryCost : retryCost; + const hasRetryTokens = (error3) => getCapacityAmount(error3) <= availableCapacity; + const retrieveRetryTokens = (error3) => { + if (!hasRetryTokens(error3)) { throw new Error("No retry token available"); } - const capacityAmount = getCapacityAmount(error2); + const capacityAmount = getCapacityAmount(error3); availableCapacity -= capacityAmount; return capacityAmount; }; @@ -31776,11 +28838,11 @@ var require_dist_cjs35 = __commonJS({ }); }; var defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - var defaultRetryDecider = (error2) => { - if (!error2) { + var defaultRetryDecider = (error3) => { + if (!error3) { return false; } - return serviceErrorClassification.isRetryableByTrait(error2) || serviceErrorClassification.isClockSkewError(error2) || serviceErrorClassification.isThrottlingError(error2) || serviceErrorClassification.isTransientError(error2); + return serviceErrorClassification.isRetryableByTrait(error3) || serviceErrorClassification.isClockSkewError(error3) || serviceErrorClassification.isThrottlingError(error3) || serviceErrorClassification.isTransientError(error3); }; var StandardRetryStrategy = class { maxAttemptsProvider; @@ -31794,14 +28856,14 @@ var require_dist_cjs35 = __commonJS({ this.delayDecider = options?.delayDecider ?? defaultDelayDecider; this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS); } - shouldRetry(error2, attempts, maxAttempts) { - return attempts < maxAttempts && this.retryDecider(error2) && this.retryQuota.hasRetryTokens(error2); + shouldRetry(error3, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error3) && this.retryQuota.hasRetryTokens(error3); } async getMaxAttempts() { let maxAttempts; try { maxAttempts = await this.maxAttemptsProvider(); - } catch (error2) { + } catch (error3) { maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS; } return maxAttempts; @@ -32049,23 +29111,23 @@ var require_dist_cjs35 = __commonJS({ }; var cooldown = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; - var getRetryErrorInfo = (error2, logger2) => { + var getRetryErrorInfo = (error3, logger2) => { const errorInfo = { - error: error2, - errorType: getRetryErrorType(error2) + error: error3, + errorType: getRetryErrorType(error3) }; - const retryAfterHint = parseRetryAfterHeader(error2.$response, logger2); + const retryAfterHint = parseRetryAfterHeader(error3.$response, logger2); if (retryAfterHint) { errorInfo.retryAfterHint = retryAfterHint; } return errorInfo; }; - var getRetryErrorType = (error2) => { - if (serviceErrorClassification.isThrottlingError(error2)) + var getRetryErrorType = (error3) => { + if (serviceErrorClassification.isThrottlingError(error3)) return "THROTTLING"; - if (serviceErrorClassification.isTransientError(error2)) + if (serviceErrorClassification.isTransientError(error3)) return "TRANSIENT"; - if (serviceErrorClassification.isServerError(error2)) + if (serviceErrorClassification.isServerError(error3)) return "SERVER_ERROR"; return "CLIENT_ERROR"; }; @@ -32205,18 +29267,18 @@ var init_AwsSdkSigV4Signer = __esm({ return signedRequest; } errorHandler(signingProperties) { - return (error2) => { - const serverTime = error2.ServerTime ?? getDateHeader(error2.$response); + return (error3) => { + const serverTime = error3.ServerTime ?? getDateHeader(error3.$response); if (serverTime) { const config = throwSigningPropertyError("config", signingProperties.config); const initialSystemClockOffset = config.systemClockOffset; config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; - if (clockSkewCorrected && error2.$metadata) { - error2.$metadata.clockSkewCorrected = true; + if (clockSkewCorrected && error3.$metadata) { + error3.$metadata.clockSkewCorrected = true; } } - throw error2; + throw error3; }; } successHandler(httpResponse, signingProperties) { @@ -34212,20 +31274,20 @@ var init_ProtocolLib = __esm({ decorateServiceException(exception, additions = {}) { if (this.queryCompat) { const msg = exception.Message ?? additions.Message; - const error2 = (0, import_smithy_client.decorateServiceException)(exception, additions); + const error3 = (0, import_smithy_client.decorateServiceException)(exception, additions); if (msg) { - error2.message = msg; + error3.message = msg; } - const errorObj = error2.Error ?? {}; - errorObj.Type = error2.Error?.Type; - errorObj.Code = error2.Error?.Code; - errorObj.Message = error2.Error?.message ?? error2.Error?.Message ?? msg; - error2.Error = errorObj; - const reqId = error2.$metadata.requestId; + const errorObj = error3.Error ?? {}; + errorObj.Type = error3.Error?.Type; + errorObj.Code = error3.Error?.Code; + errorObj.Message = error3.Error?.message ?? error3.Error?.Message ?? msg; + error3.Error = errorObj; + const reqId = error3.$metadata.requestId; if (reqId) { - error2.RequestId = reqId; + error3.RequestId = reqId; } - return error2; + return error3; } return (0, import_smithy_client.decorateServiceException)(exception, additions); } @@ -34336,15 +31398,15 @@ var init_coercing_serializers = __esm({ return val; } if (typeof val === "number" || typeof val === "bigint") { - const warning = new Error(`Received number ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); + const warning2 = new Error(`Received number ${val} where a string was expected.`); + warning2.name = "Warning"; + console.warn(warning2); return String(val); } if (typeof val === "boolean") { - const warning = new Error(`Received boolean ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); + const warning2 = new Error(`Received boolean ${val} where a string was expected.`); + warning2.name = "Warning"; + console.warn(warning2); return String(val); } return val; @@ -34358,9 +31420,9 @@ var init_coercing_serializers = __esm({ if (typeof val === "string") { const lowercase = val.toLowerCase(); if (val !== "" && lowercase !== "false" && lowercase !== "true") { - const warning = new Error(`Received string "${val}" where a boolean was expected.`); - warning.name = "Warning"; - console.warn(warning); + const warning2 = new Error(`Received string "${val}" where a boolean was expected.`); + warning2.name = "Warning"; + console.warn(warning2); } return val !== "" && lowercase !== "false"; } @@ -34375,9 +31437,9 @@ var init_coercing_serializers = __esm({ if (typeof val === "string") { const num = Number(val); if (num.toString() !== val) { - const warning = new Error(`Received string "${val}" where a number was expected.`); - warning.name = "Warning"; - console.warn(warning); + const warning2 = new Error(`Received string "${val}" where a number was expected.`); + warning2.name = "Warning"; + console.warn(warning2); return val; } return num; @@ -38259,7 +35321,7 @@ var require_dist_cjs39 = __commonJS({ var signatureV4 = require_dist_cjs36(); var utilConfigProvider = require_dist_cjs25(); var client = (init_client(), __toCommonJS(client_exports)); - var core5 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilMiddleware = require_dist_cjs6(); var CONTENT_LENGTH_HEADER = "content-length"; var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length"; @@ -38483,8 +35545,8 @@ var require_dist_cjs39 = __commonJS({ return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } async getIdentity(key) { - await this.cache.purgeExpired().catch((error2) => { - console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error2); + await this.cache.purgeExpired().catch((error3) => { + console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error3); }); const session = await this.createSessionFn(key); if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) { @@ -38594,12 +35656,12 @@ var require_dist_cjs39 = __commonJS({ } return signedRequest; }; - var defaultErrorHandler2 = (signingProperties) => (error2) => { - throw error2; + var defaultErrorHandler2 = (signingProperties) => (error3) => { + throw error3; }; var defaultSuccessHandler2 = (httpResponse, signingProperties) => { }; - var s3ExpressHttpSigningMiddlewareOptions = core5.httpSigningMiddlewareOptions; + var s3ExpressHttpSigningMiddlewareOptions = core.httpSigningMiddlewareOptions; var s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => { if (!protocolHttp.HttpRequest.isInstance(args.request)) { return next(args); @@ -38625,7 +35687,7 @@ var require_dist_cjs39 = __commonJS({ }; var getS3ExpressHttpSigningPlugin = (config) => ({ applyToStack: (clientStack) => { - clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core5.httpSigningMiddlewareOptions); + clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core.httpSigningMiddlewareOptions); } }); var resolveS3Config = (input, { session }) => { @@ -38706,11 +35768,11 @@ var require_dist_cjs39 = __commonJS({ url: bucketEndpointUrl }; } catch (e5) { - const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`; + const warning2 = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`; if (context.logger?.constructor?.name === "NoOpLogger") { - console.warn(warning); + console.warn(warning2); } else { - context.logger?.warn?.(warning); + context.logger?.warn?.(warning2); } throw e5; } @@ -39280,7 +36342,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.1038.0", + version: "3.1044.0", scripts: { build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline client-sts", @@ -39306,18 +36368,18 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "^3.974.6", - "@aws-sdk/credential-provider-node": "^3.972.37", + "@aws-sdk/core": "^3.974.8", + "@aws-sdk/credential-provider-node": "^3.972.39", "@aws-sdk/middleware-host-header": "^3.972.10", "@aws-sdk/middleware-logger": "^3.972.10", "@aws-sdk/middleware-recursion-detection": "^3.972.11", - "@aws-sdk/middleware-user-agent": "^3.972.36", + "@aws-sdk/middleware-user-agent": "^3.972.38", "@aws-sdk/region-config-resolver": "^3.972.13", - "@aws-sdk/signature-v4-multi-region": "^3.996.23", + "@aws-sdk/signature-v4-multi-region": "^3.996.25", "@aws-sdk/types": "^3.973.8", "@aws-sdk/util-endpoints": "^3.996.8", "@aws-sdk/util-user-agent-browser": "^3.972.10", - "@aws-sdk/util-user-agent-node": "^3.973.22", + "@aws-sdk/util-user-agent-node": "^3.973.24", "@smithy/config-resolver": "^4.4.17", "@smithy/core": "^3.23.17", "@smithy/fetch-http-handler": "^5.3.17", @@ -39325,7 +36387,7 @@ var require_package = __commonJS({ "@smithy/invalid-dependency": "^4.2.14", "@smithy/middleware-content-length": "^4.2.14", "@smithy/middleware-endpoint": "^4.4.32", - "@smithy/middleware-retry": "^4.5.6", + "@smithy/middleware-retry": "^4.5.7", "@smithy/middleware-serde": "^4.2.20", "@smithy/middleware-stack": "^4.2.14", "@smithy/node-config-provider": "^4.3.14", @@ -39341,7 +36403,7 @@ var require_package = __commonJS({ "@smithy/util-defaults-mode-node": "^4.2.54", "@smithy/util-endpoints": "^3.4.2", "@smithy/util-middleware": "^4.2.14", - "@smithy/util-retry": "^4.3.5", + "@smithy/util-retry": "^4.3.6", "@smithy/util-utf8": "^4.2.2", tslib: "^2.6.2" }, @@ -39440,12 +36502,12 @@ var require_dist_cjs42 = __commonJS({ var propertyProvider = require_dist_cjs28(); var url = require("url"); var buffer = require("buffer"); - var http5 = require("http"); + var http6 = require("http"); var nodeConfigProvider = require_dist_cjs30(); var urlParser = require_dist_cjs18(); function httpRequest(options) { return new Promise((resolve, reject) => { - const req = http5.request({ + const req = http6.request({ method: "GET", ...options, hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1") @@ -39724,12 +36786,12 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL); let token; try { token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } catch (error2) { - if (error2?.statusCode === 400) { - throw Object.assign(error2, { + } catch (error3) { + if (error3?.statusCode === 400) { + throw Object.assign(error3, { message: "EC2 Metadata token request returned error" }); - } else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) { + } else if (error3.message === "TimeoutError" || [403, 404, 405].includes(error3.statusCode)) { disableFetchToken = true; } logger2?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); @@ -40062,7 +37124,7 @@ var init_package = __esm({ "node_modules/@aws-sdk/nested-clients/package.json"() { package_default = { name: "@aws-sdk/nested-clients", - version: "3.997.4", + version: "3.997.6", description: "Nested clients for AWS SDK packages.", main: "./dist-cjs/index.js", module: "./dist-es/index.js", @@ -40091,17 +37153,17 @@ var init_package = __esm({ dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "^3.974.6", + "@aws-sdk/core": "^3.974.8", "@aws-sdk/middleware-host-header": "^3.972.10", "@aws-sdk/middleware-logger": "^3.972.10", "@aws-sdk/middleware-recursion-detection": "^3.972.11", - "@aws-sdk/middleware-user-agent": "^3.972.36", + "@aws-sdk/middleware-user-agent": "^3.972.38", "@aws-sdk/region-config-resolver": "^3.972.13", - "@aws-sdk/signature-v4-multi-region": "^3.996.23", + "@aws-sdk/signature-v4-multi-region": "^3.996.25", "@aws-sdk/types": "^3.973.8", "@aws-sdk/util-endpoints": "^3.996.8", "@aws-sdk/util-user-agent-browser": "^3.972.10", - "@aws-sdk/util-user-agent-node": "^3.973.22", + "@aws-sdk/util-user-agent-node": "^3.973.24", "@smithy/config-resolver": "^4.4.17", "@smithy/core": "^3.23.17", "@smithy/fetch-http-handler": "^5.3.17", @@ -40109,7 +37171,7 @@ var init_package = __esm({ "@smithy/invalid-dependency": "^4.2.14", "@smithy/middleware-content-length": "^4.2.14", "@smithy/middleware-endpoint": "^4.4.32", - "@smithy/middleware-retry": "^4.5.6", + "@smithy/middleware-retry": "^4.5.7", "@smithy/middleware-serde": "^4.2.20", "@smithy/middleware-stack": "^4.2.14", "@smithy/node-config-provider": "^4.3.14", @@ -40125,7 +37187,7 @@ var init_package = __esm({ "@smithy/util-defaults-mode-node": "^4.2.54", "@smithy/util-endpoints": "^3.4.2", "@smithy/util-middleware": "^4.2.14", - "@smithy/util-retry": "^4.3.5", + "@smithy/util-retry": "^4.3.6", "@smithy/util-utf8": "^4.2.2", tslib: "^2.6.2" }, @@ -40218,7 +37280,7 @@ var require_dist_cjs44 = __commonJS({ var node_os = require("node:os"); var node_process = require("node:process"); var utilConfigProvider = require_dist_cjs25(); - var promises = require("node:fs/promises"); + var promises3 = require("node:fs/promises"); var node_path = require("node:path"); var middlewareUserAgent = require_dist_cjs24(); var getRuntimeUserAgentPair = () => { @@ -40289,7 +37351,7 @@ var require_dist_cjs44 = __commonJS({ for (const nodeModulesParentDir of nodeModulesParentDirs) { try { const appPackageJsonPath = node_path.join(nodeModulesParentDir, "package.json"); - const packageJson = await promises.readFile(appPackageJsonPath, "utf-8"); + const packageJson = await promises3.readFile(appPackageJsonPath, "utf-8"); const { dependencies, devDependencies } = JSON.parse(packageJson); const version = devDependencies?.typescript ?? dependencies?.typescript; if (typeof version !== "string") { @@ -40308,7 +37370,7 @@ var require_dist_cjs44 = __commonJS({ for (const nodeModulesParentDir of nodeModulesParentDirs) { try { const tsPackageJsonPath = node_path.join(nodeModulesParentDir, TS_PACKAGE_JSON); - const packageJson = await promises.readFile(tsPackageJsonPath, "utf-8"); + const packageJson = await promises3.readFile(tsPackageJsonPath, "utf-8"); const { version } = JSON.parse(packageJson); const sanitizedVersion2 = getSanitizedTypeScriptVersion(version); if (typeof sanitizedVersion2 !== "string") { @@ -40394,7 +37456,7 @@ var require_dist_cjs45 = __commonJS({ var utilBufferFrom = require_dist_cjs8(); var utilUtf8 = require_dist_cjs9(); var buffer = require("buffer"); - var crypto3 = require("crypto"); + var crypto4 = require("crypto"); var Hash5 = class { algorithmIdentifier; secret; @@ -40411,7 +37473,7 @@ var require_dist_cjs45 = __commonJS({ return Promise.resolve(this.hash.digest()); } reset() { - this.hash = this.secret ? crypto3.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto3.createHash(this.algorithmIdentifier); + this.hash = this.secret ? crypto4.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto4.createHash(this.algorithmIdentifier); } }; function castSourceData(toCast, encoding) { @@ -41286,8 +38348,8 @@ var init_CreateTokenCommand = __esm({ import_smithy_client13 = __toESM(require_dist_cjs34()); init_EndpointParameters(); init_schemas_0(); - CreateTokenCommand = class extends import_smithy_client13.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o2) { - return [(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + CreateTokenCommand = class extends import_smithy_client13.Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) { + return [(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").sc(CreateToken$).build() { }; } @@ -41444,11 +38506,11 @@ var require_dist_cjs49 = __commonJS({ throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); } }; - var { writeFile } = node_fs.promises; + var { writeFile: writeFile2 } = node_fs.promises; var writeSSOTokenToFile = (id, ssoToken) => { const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id); const tokenString = JSON.stringify(ssoToken, null, 2); - return writeFile(tokenFilepath, tokenString); + return writeFile2(tokenFilepath, tokenString); }; var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0); var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => { @@ -41509,13 +38571,13 @@ var require_dist_cjs49 = __commonJS({ expiresAt: newTokenExpiration.toISOString(), refreshToken: newSsoOidcToken.refreshToken }); - } catch (error2) { + } catch (error3) { } return { token: newSsoOidcToken.accessToken, expiration: newTokenExpiration }; - } catch (error2) { + } catch (error3) { validateTokenExpiry(existingToken); return existingToken; } @@ -42120,8 +39182,8 @@ var init_GetRoleCredentialsCommand = __esm({ import_smithy_client20 = __toESM(require_dist_cjs34()); init_EndpointParameters2(); init_schemas_02(); - GetRoleCredentialsCommand = class extends import_smithy_client20.Command.classBuilder().ep(commonParams2).m(function(Command, cs, config, o2) { - return [(0, import_middleware_endpoint4.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + GetRoleCredentialsCommand = class extends import_smithy_client20.Command.classBuilder().ep(commonParams2).m(function(Command2, cs, config, o2) { + return [(0, import_middleware_endpoint4.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials$).build() { }; } @@ -43020,8 +40082,8 @@ var init_CreateOAuth2TokenCommand = __esm({ import_smithy_client27 = __toESM(require_dist_cjs34()); init_EndpointParameters3(); init_schemas_03(); - CreateOAuth2TokenCommand = class extends import_smithy_client27.Command.classBuilder().ep(commonParams3).m(function(Command, cs, config, o2) { - return [(0, import_middleware_endpoint6.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + CreateOAuth2TokenCommand = class extends import_smithy_client27.Command.classBuilder().ep(commonParams3).m(function(Command2, cs, config, o2) { + return [(0, import_middleware_endpoint6.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token$).build() { }; } @@ -43218,9 +40280,9 @@ var require_dist_cjs51 = __commonJS({ accountId: newAccessToken.accountId, expiration }; - } catch (error2) { - if (error2.name === "AccessDeniedException") { - const errorType = error2.error; + } catch (error3) { + if (error3.name === "AccessDeniedException") { + const errorType = error3.error; let message; switch (errorType) { case "TOKEN_EXPIRED": @@ -43233,11 +40295,11 @@ var require_dist_cjs51 = __commonJS({ message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action."; break; default: - message = `Failed to refresh token: ${String(error2)}. Please re-authenticate using \`aws login\``; + message = `Failed to refresh token: ${String(error3)}. Please re-authenticate using \`aws login\``; } throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false }); } - throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error2)}. Please re-authenticate using aws login`, { logger: this.logger }); + throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error3)}. Please re-authenticate using aws login`, { logger: this.logger }); } } async loadToken() { @@ -43261,8 +40323,8 @@ var require_dist_cjs51 = __commonJS({ }); } return token; - } catch (error2) { - throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error2)}`, { + } catch (error3) { + throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error3)}`, { logger: this.logger, tryNextLink: false }); @@ -43273,7 +40335,7 @@ var require_dist_cjs51 = __commonJS({ const directory = node_path.dirname(tokenFilePath); try { await node_fs.promises.mkdir(directory, { recursive: true }); - } catch (error2) { + } catch (error3) { } await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); } @@ -43364,8 +40426,8 @@ var require_dist_cjs51 = __commonJS({ const rawSignature = this.derToRawSignature(asn1Signature); const signatureB64 = rawSignature.toString("base64url"); return `${message}.${signatureB64}`; - } catch (error2) { - throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error2 instanceof Error ? error2.message : String(error2)}`, { logger: this.logger, tryNextLink: false }); + } catch (error3) { + throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error3 instanceof Error ? error3.message : String(error3)}`, { logger: this.logger, tryNextLink: false }); } } }; @@ -44307,8 +41369,8 @@ var init_AssumeRoleCommand = __esm({ import_smithy_client34 = __toESM(require_dist_cjs34()); init_EndpointParameters4(); init_schemas_04(); - AssumeRoleCommand = class extends import_smithy_client34.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o2) { - return [(0, import_middleware_endpoint9.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + AssumeRoleCommand = class extends import_smithy_client34.Command.classBuilder().ep(commonParams4).m(function(Command2, cs, config, o2) { + return [(0, import_middleware_endpoint9.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() { }; } @@ -44322,8 +41384,8 @@ var init_AssumeRoleWithWebIdentityCommand = __esm({ import_smithy_client35 = __toESM(require_dist_cjs34()); init_EndpointParameters4(); init_schemas_04(); - AssumeRoleWithWebIdentityCommand = class extends import_smithy_client35.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o2) { - return [(0, import_middleware_endpoint10.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + AssumeRoleWithWebIdentityCommand = class extends import_smithy_client35.Command.classBuilder().ep(commonParams4).m(function(Command2, cs, config, o2) { + return [(0, import_middleware_endpoint10.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() { }; } @@ -44605,8 +41667,8 @@ var require_dist_cjs52 = __commonJS({ throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); } return getValidatedProcessCredentials(profileName, data3, profiles); - } catch (error2) { - throw new propertyProvider.CredentialsProviderError(error2.message, { logger: logger2 }); + } catch (error3) { + throw new propertyProvider.CredentialsProviderError(error3.message, { logger: logger2 }); } } else { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger2 }); @@ -46166,48 +43228,48 @@ var require_dist_cjs56 = __commonJS({ var client = (init_client(), __toCommonJS(client_exports)); var regionConfigResolver = require_dist_cjs48(); var STSServiceException2 = require_STSServiceException(); - var AssumeRoleCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var AssumeRoleCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(schemas_0.AssumeRole$).build() { }; - var AssumeRoleWithSAMLCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var AssumeRoleWithSAMLCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").sc(schemas_0.AssumeRoleWithSAML$).build() { }; - var AssumeRoleWithWebIdentityCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var AssumeRoleWithWebIdentityCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(schemas_0.AssumeRoleWithWebIdentity$).build() { }; - var AssumeRootCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var AssumeRootCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").sc(schemas_0.AssumeRoot$).build() { }; - var DecodeAuthorizationMessageCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var DecodeAuthorizationMessageCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").sc(schemas_0.DecodeAuthorizationMessage$).build() { }; - var GetAccessKeyInfoCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetAccessKeyInfoCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").sc(schemas_0.GetAccessKeyInfo$).build() { }; - var GetCallerIdentityCommand2 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetCallerIdentityCommand2 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").sc(schemas_0.GetCallerIdentity$).build() { }; - var GetDelegatedAccessTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetDelegatedAccessTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetDelegatedAccessToken", {}).n("STSClient", "GetDelegatedAccessTokenCommand").sc(schemas_0.GetDelegatedAccessToken$).build() { }; - var GetFederationTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetFederationTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").sc(schemas_0.GetFederationToken$).build() { }; - var GetSessionTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetSessionTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").sc(schemas_0.GetSessionToken$).build() { }; - var GetWebIdentityTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config, o2) { - return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + var GetWebIdentityTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { + return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetWebIdentityToken", {}).n("STSClient", "GetWebIdentityTokenCommand").sc(schemas_0.GetWebIdentityToken$).build() { }; var commands5 = { @@ -46392,15 +43454,15 @@ var init_helpers = __esm({ }); // node_modules/proxy-agent/node_modules/agent-base/dist/index.js -var net, http, import_https, INTERNAL, Agent2; +var net, http2, import_https, INTERNAL, Agent4; var init_dist = __esm({ "node_modules/proxy-agent/node_modules/agent-base/dist/index.js"() { net = __toESM(require("net"), 1); - http = __toESM(require("http"), 1); + http2 = __toESM(require("http"), 1); import_https = require("https"); init_helpers(); INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); - Agent2 = class extends http.Agent { + Agent4 = class extends http2.Agent { constructor(opts) { super(opts); this[INTERNAL] = {}; @@ -46662,11 +43724,11 @@ var require_common = __commonJS({ let enableOverride = null; let namespacesCache; let enabledCache; - function debug19(...args) { - if (!debug19.enabled) { + function debug17(...args) { + if (!debug17.enabled) { return; } - const self = debug19; + const self = debug17; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self.diff = ms; @@ -46696,12 +43758,12 @@ var require_common = __commonJS({ const logFn = self.log || createDebug16.log; logFn.apply(self, args); } - debug19.namespace = namespace; - debug19.useColors = createDebug16.useColors(); - debug19.color = createDebug16.selectColor(namespace); - debug19.extend = extend; - debug19.destroy = createDebug16.destroy; - Object.defineProperty(debug19, "enabled", { + debug17.namespace = namespace; + debug17.useColors = createDebug16.useColors(); + debug17.color = createDebug16.selectColor(namespace); + debug17.extend = extend; + debug17.destroy = createDebug16.destroy; + Object.defineProperty(debug17, "enabled", { enumerable: true, configurable: false, get: () => { @@ -46719,9 +43781,9 @@ var require_common = __commonJS({ } }); if (typeof createDebug16.init === "function") { - createDebug16.init(debug19); + createDebug16.init(debug17); } - return debug19; + return debug17; } function extend(namespace, delimiter) { const newDebug = createDebug16(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); @@ -46945,14 +44007,14 @@ var require_browser = __commonJS({ } else { exports2.storage.removeItem("debug"); } - } catch (error2) { + } catch (error3) { } } function load() { let r5; try { r5 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error2) { + } catch (error3) { } if (!r5 && typeof process !== "undefined" && "env" in process) { r5 = process.env.DEBUG; @@ -46962,7 +44024,7 @@ var require_browser = __commonJS({ function localstorage() { try { return localStorage; - } catch (error2) { + } catch (error3) { } } module2.exports = require_common()(exports2); @@ -46970,8 +44032,8 @@ var require_browser = __commonJS({ formatters.j = function(v) { try { return JSON.stringify(v); - } catch (error2) { - return "[UnexpectedJSONParseError]: " + error2.message; + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } }; } @@ -46994,7 +44056,7 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var os3 = require("os"); + var os7 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; @@ -47042,7 +44104,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os3.release().split("."); + const osRelease = os7.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -47191,7 +44253,7 @@ var require_node = __commonJS({ 221 ]; } - } catch (error2) { + } catch (error3) { } exports2.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); @@ -47246,11 +44308,11 @@ var require_node = __commonJS({ function load() { return process.env.DEBUG; } - function init(debug19) { - debug19.inspectOpts = {}; + function init(debug17) { + debug17.inspectOpts = {}; const keys = Object.keys(exports2.inspectOpts); for (let i5 = 0; i5 < keys.length; i5++) { - debug19.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]]; + debug17.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]]; } } module2.exports = require_common()(exports2); @@ -47292,7 +44354,7 @@ function omit(obj, ...keys) { } return ret; } -var net2, tls, import_debug, import_events, import_url, debug3, HttpProxyAgent; +var net2, tls, import_debug, import_events, import_url, debug2, HttpProxyAgent; var init_dist2 = __esm({ "node_modules/proxy-agent/node_modules/http-proxy-agent/dist/index.js"() { net2 = __toESM(require("net"), 1); @@ -47301,13 +44363,13 @@ var init_dist2 = __esm({ import_events = require("events"); init_dist(); import_url = require("url"); - debug3 = (0, import_debug.default)("http-proxy-agent"); - HttpProxyAgent = class extends Agent2 { + debug2 = (0, import_debug.default)("http-proxy-agent"); + HttpProxyAgent = class extends Agent4 { constructor(proxy, opts) { super(opts); this.proxy = typeof proxy === "string" ? new import_url.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; - debug3("Creating new HttpProxyAgent instance: %o", this.proxy.href); + debug2("Creating new HttpProxyAgent instance: %o", this.proxy.href); const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { @@ -47353,21 +44415,21 @@ var init_dist2 = __esm({ } let first; let endOfHeaders; - debug3("Regenerating stored HTTP header string for request"); + debug2("Regenerating stored HTTP header string for request"); req._implicitHeader(); if (req.outputData && req.outputData.length > 0) { - debug3("Patching connection write() output buffer with updated header"); + debug2("Patching connection write() output buffer with updated header"); first = req.outputData[0].data; endOfHeaders = first.indexOf("\r\n\r\n") + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); - debug3("Output buffer: %o", req.outputData[0].data); + debug2("Output buffer: %o", req.outputData[0].data); } let socket; if (this.proxy.protocol === "https:") { - debug3("Creating `tls.Socket`: %o", this.connectOpts); + debug2("Creating `tls.Socket`: %o", this.connectOpts); socket = tls.connect(this.connectOpts); } else { - debug3("Creating `net.Socket`: %o", this.connectOpts); + debug2("Creating `net.Socket`: %o", this.connectOpts); socket = net2.connect(this.connectOpts); } await (0, import_events.once)(socket, "connect"); @@ -47397,12 +44459,12 @@ function parseProxyResponse(socket) { } function onend() { cleanup(); - debug4("onend"); + debug3("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } function onerror(err) { cleanup(); - debug4("onerror %o", err); + debug3("onerror %o", err); reject(err); } function ondata(b6) { @@ -47411,7 +44473,7 @@ function parseProxyResponse(socket) { const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf("\r\n\r\n"); if (endOfHeaders === -1) { - debug4("have not received end of HTTP headers yet..."); + debug3("have not received end of HTTP headers yet..."); read(); return; } @@ -47444,7 +44506,7 @@ function parseProxyResponse(socket) { headers[key] = value; } } - debug4("got proxy server response: %o %o", firstLine, headers); + debug3("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { @@ -47460,11 +44522,11 @@ function parseProxyResponse(socket) { read(); }); } -var import_debug2, debug4; +var import_debug2, debug3; var init_parse_proxy_response = __esm({ "node_modules/proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js"() { import_debug2 = __toESM(require_src(), 1); - debug4 = (0, import_debug2.default)("https-proxy-agent:parse-proxy-response"); + debug3 = (0, import_debug2.default)("https-proxy-agent:parse-proxy-response"); } }); @@ -47486,7 +44548,7 @@ function omit2(obj, ...keys) { } return ret; } -var net3, tls2, import_assert, import_debug3, import_url2, debug5, setServernameFromNonIpHost, HttpsProxyAgent; +var net3, tls2, import_assert, import_debug3, import_url2, debug4, setServernameFromNonIpHost, HttpsProxyAgent; var init_dist3 = __esm({ "node_modules/proxy-agent/node_modules/https-proxy-agent/dist/index.js"() { net3 = __toESM(require("net"), 1); @@ -47496,7 +44558,7 @@ var init_dist3 = __esm({ init_dist(); import_url2 = require("url"); init_parse_proxy_response(); - debug5 = (0, import_debug3.default)("https-proxy-agent"); + debug4 = (0, import_debug3.default)("https-proxy-agent"); setServernameFromNonIpHost = (options) => { if (options.servername === void 0 && options.host && !net3.isIP(options.host)) { return { @@ -47506,13 +44568,13 @@ var init_dist3 = __esm({ } return options; }; - HttpsProxyAgent = class extends Agent2 { + HttpsProxyAgent = class extends Agent4 { constructor(proxy, opts) { super(opts); this.options = { path: void 0 }; this.proxy = typeof proxy === "string" ? new import_url2.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; - debug5("Creating new HttpsProxyAgent instance: %o", this.proxy.href); + debug4("Creating new HttpsProxyAgent instance: %o", this.proxy.href); const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { @@ -47534,10 +44596,10 @@ var init_dist3 = __esm({ } let socket; if (proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); + debug4("Creating `tls.Socket`: %o", this.connectOpts); socket = tls2.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - debug5("Creating `net.Socket`: %o", this.connectOpts); + debug4("Creating `net.Socket`: %o", this.connectOpts); socket = net3.connect(this.connectOpts); } const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; @@ -47565,7 +44627,7 @@ var init_dist3 = __esm({ if (connect13.statusCode === 200) { req.once("socket", resume); if (opts.secureEndpoint) { - debug5("Upgrading socket connection to TLS"); + debug4("Upgrading socket connection to TLS"); return tls2.connect({ ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"), socket @@ -47577,7 +44639,7 @@ var init_dist3 = __esm({ const fakeSocket = new net3.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); + debug4("Replaying proxy buffer for failed request"); (0, import_assert.default)(s.listenerCount("data") > 0); s.push(buffered); s.push(null); @@ -47590,7 +44652,7 @@ var init_dist3 = __esm({ }); // node_modules/smart-buffer/build/utils.js -var require_utils3 = __commonJS({ +var require_utils2 = __commonJS({ "node_modules/smart-buffer/build/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -47663,7 +44725,7 @@ var require_smartbuffer = __commonJS({ "node_modules/smart-buffer/build/smartbuffer.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils3(); + var utils_1 = require_utils2(); var DEFAULT_SMARTBUFFER_SIZE = 4096; var DEFAULT_SMARTBUFFER_ENCODING = "utf8"; var SmartBuffer = class _SmartBuffer { @@ -48956,6 +46018,23 @@ var require_util9 = __commonJS({ } }); +// node_modules/ip-address/dist/address-error.js +var require_address_error = __commonJS({ + "node_modules/ip-address/dist/address-error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AddressError = void 0; + var AddressError = class extends Error { + constructor(message, parseMessage) { + super(message); + this.name = "AddressError"; + this.parseMessage = parseMessage; + } + }; + exports2.AddressError = AddressError; + } +}); + // node_modules/ip-address/dist/common.js var require_common2 = __commonJS({ "node_modules/ip-address/dist/common.js"(exports2) { @@ -48963,9 +46042,11 @@ var require_common2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isInSubnet = isInSubnet; exports2.isCorrect = isCorrect; + exports2.prefixLengthFromMask = prefixLengthFromMask; exports2.numberToPaddedHex = numberToPaddedHex; exports2.stringToPaddedHex = stringToPaddedHex; exports2.testBit = testBit; + var address_error_1 = require_address_error(); function isInSubnet(address) { if (this.subnetMask < address.subnetMask) { return false; @@ -48986,6 +46067,20 @@ var require_common2 = __commonJS({ return this.parsedSubnet === String(this.subnetMask); }; } + function prefixLengthFromMask(value, totalBits) { + const binary = value.toString(2).padStart(totalBits, "0"); + if (binary.length > totalBits) { + throw new address_error_1.AddressError("Invalid subnet mask."); + } + const firstZero = binary.indexOf("0"); + if (firstZero === -1) { + return totalBits; + } + if (binary.slice(firstZero).includes("1")) { + throw new address_error_1.AddressError("Invalid subnet mask."); + } + return firstZero; + } function numberToPaddedHex(number) { return number.toString(16).padStart(2, "0"); } @@ -49016,23 +46111,6 @@ var require_constants7 = __commonJS({ } }); -// node_modules/ip-address/dist/address-error.js -var require_address_error = __commonJS({ - "node_modules/ip-address/dist/address-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AddressError = void 0; - var AddressError = class extends Error { - constructor(message, parseMessage) { - super(message); - this.name = "AddressError"; - this.parseMessage = parseMessage; - } - }; - exports2.AddressError = AddressError; - } -}); - // node_modules/ip-address/dist/ipv4.js var require_ipv4 = __commonJS({ "node_modules/ip-address/dist/ipv4.js"(exports2) { @@ -49067,32 +46145,40 @@ var require_ipv4 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Address4 = void 0; var common = __importStar2(require_common2()); - var constants = __importStar2(require_constants7()); + var constants3 = __importStar2(require_constants7()); var address_error_1 = require_address_error(); + var isCorrect4 = common.isCorrect(constants3.BITS); var Address4 = class _Address4 { constructor(address) { - this.groups = constants.GROUPS; + this.groups = constants3.GROUPS; this.parsedAddress = []; this.parsedSubnet = ""; this.subnet = "/32"; this.subnetMask = 32; this.v4 = true; - this.isCorrect = common.isCorrect(constants.BITS); + this.isCorrect = isCorrect4; this.isInSubnet = common.isInSubnet; this.address = address; - const subnet = constants.RE_SUBNET_STRING.exec(address); + const subnet = constants3.RE_SUBNET_STRING.exec(address); if (subnet) { this.parsedSubnet = subnet[0].replace("/", ""); this.subnetMask = parseInt(this.parsedSubnet, 10); this.subnet = `/${this.subnetMask}`; - if (this.subnetMask < 0 || this.subnetMask > constants.BITS) { + if (this.subnetMask < 0 || this.subnetMask > constants3.BITS) { throw new address_error_1.AddressError("Invalid subnet mask."); } - address = address.replace(constants.RE_SUBNET_STRING, ""); + address = address.replace(constants3.RE_SUBNET_STRING, ""); } this.addressMinusSuffix = address; this.parsedAddress = this.parse(address); } + /** + * Returns true if the given string is a valid IPv4 address (with optional + * CIDR subnet), false otherwise. Host bits in the subnet portion are + * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address + * validation compare `correctForm()` to `startAddress().correctForm()`, + * or use `networkForm()`. + */ static isValid(address) { try { new _Address4(address); @@ -49101,56 +46187,122 @@ var require_ipv4 = __commonJS({ return false; } } - /* - * Parses a v4 address + /** + * Parses an IPv4 address string into its four octet groups and stores the + * result on `this.parsedAddress`. Called automatically by the constructor; + * you typically don't need to call it directly. Throws `AddressError` if + * the input is not a valid IPv4 address. */ parse(address) { const groups = address.split("."); - if (!address.match(constants.RE_ADDRESS)) { + if (!address.match(constants3.RE_ADDRESS)) { throw new address_error_1.AddressError("Invalid IPv4 address."); } return groups; } /** - * Returns the correct form of an address - * @memberof Address4 - * @instance - * @returns {String} + * Returns the address in correct form: octets joined with `.` and any + * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the + * canonical dotted-decimal representation. */ correctForm() { return this.parsedAddress.map((part) => parseInt(part, 10)).join("."); } /** - * Converts a hex string to an IPv4 address object - * @memberof Address4 - * @static + * Construct an `Address4` from an address and a dotted-decimal subnet + * mask given as separate strings (e.g. as returned by Node's + * `os.networkInterfaces()`). Throws `AddressError` if the mask is + * non-contiguous (e.g. `255.0.255.0`). + * @example + * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0'); + * address.subnetMask; // 24 + */ + static fromAddressAndMask(address, mask) { + const bits = common.prefixLengthFromMask(new _Address4(mask).bigInt(), constants3.BITS); + return new _Address4(`${address}/${bits}`); + } + /** + * Construct an `Address4` from an address and a Cisco-style wildcard mask + * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard + * mask is the bitwise inverse of the subnet mask. Throws `AddressError` + * if the mask is non-contiguous (e.g. `0.255.0.255`). + * @example + * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255'); + * address.subnetMask; // 24 + */ + static fromAddressAndWildcardMask(address, wildcardMask) { + const wildcard = new _Address4(wildcardMask).bigInt(); + const allOnes = (BigInt(1) << BigInt(constants3.BITS)) - BigInt(1); + const mask = wildcard ^ allOnes; + const bits = common.prefixLengthFromMask(mask, constants3.BITS); + return new _Address4(`${address}/${bits}`); + } + /** + * Construct an `Address4` from a wildcard pattern with trailing `*` + * octets. The number of trailing wildcards determines the prefix + * length: each `*` represents 8 bits. + * + * Only trailing whole-octet wildcards are supported. Partial-octet + * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g. + * `192.*.0.1`) throw `AddressError`. + * @example + * Address4.fromWildcard('192.168.0.*').subnet; // '/24' + * Address4.fromWildcard('192.168.*.*').subnet; // '/16' + * Address4.fromWildcard('*.*.*.*').subnet; // '/0' + */ + static fromWildcard(input) { + const groups = input.split("."); + if (groups.length !== constants3.GROUPS) { + throw new address_error_1.AddressError("Wildcard pattern must have 4 octets"); + } + let firstWildcard = -1; + for (let i5 = 0; i5 < groups.length; i5++) { + if (groups[i5] === "*") { + if (firstWildcard === -1) { + firstWildcard = i5; + } + } else if (firstWildcard !== -1) { + throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)"); + } + } + const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard; + const replaced = groups.map((g5) => g5 === "*" ? "0" : g5); + const subnetBits = constants3.BITS - trailing * 8; + return new _Address4(`${replaced.join(".")}/${subnetBits}`); + } + /** + * Converts a hex string to an IPv4 address object. Accepts 8 hex digits + * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`). + * Throws `AddressError` for any other length or for non-hex characters. * @param {string} hex - a hex string to convert * @returns {Address4} */ static fromHex(hex) { - const padded = hex.replace(/:/g, "").padStart(8, "0"); + const stripped = hex.replace(/:/g, ""); + if (!/^[0-9a-fA-F]{8}$/.test(stripped)) { + throw new address_error_1.AddressError("IPv4 hex must be exactly 8 hex digits"); + } const groups = []; - let i5; - for (i5 = 0; i5 < 8; i5 += 2) { - const h5 = padded.slice(i5, i5 + 2); - groups.push(parseInt(h5, 16)); + for (let i5 = 0; i5 < 8; i5 += 2) { + groups.push(parseInt(stripped.slice(i5, i5 + 2), 16)); } return new _Address4(groups.join(".")); } /** - * Converts an integer into a IPv4 address object - * @memberof Address4 - * @static + * Converts an integer into a IPv4 address object. The integer must be a + * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise + * `AddressError` is thrown. * @param {integer} integer - a number to convert * @returns {Address4} */ static fromInteger(integer) { - return _Address4.fromHex(integer.toString(16)); + if (!Number.isInteger(integer) || integer < 0 || integer > 4294967295) { + throw new address_error_1.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1"); + } + return _Address4.fromHex(integer.toString(16).padStart(8, "0")); } /** * Return an address from in-addr.arpa form - * @memberof Address4 - * @static * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address * @returns {Adress4} * @example @@ -49164,17 +46316,15 @@ var require_ipv4 = __commonJS({ } /** * Converts an IPv4 address object to a hex string - * @memberof Address4 - * @instance * @returns {String} */ toHex() { return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(":"); } /** - * Converts an IPv4 address object to an array of bytes - * @memberof Address4 - * @instance + * Converts an IPv4 address object to an array of bytes. + * + * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`. * @returns {Array} */ toArray() { @@ -49182,22 +46332,18 @@ var require_ipv4 = __commonJS({ } /** * Converts an IPv4 address object to an IPv6 address group - * @memberof Address4 - * @instance * @returns {String} */ toGroup6() { const output = []; let i5; - for (i5 = 0; i5 < constants.GROUPS; i5 += 2) { + for (i5 = 0; i5 < constants3.GROUPS; i5 += 2) { output.push(`${common.stringToPaddedHex(this.parsedAddress[i5])}${common.stringToPaddedHex(this.parsedAddress[i5 + 1])}`); } return output.join(":"); } /** * Returns the address as a `bigint` - * @memberof Address4 - * @instance * @returns {bigint} */ bigInt() { @@ -49205,18 +46351,14 @@ var require_ipv4 = __commonJS({ } /** * Helper function getting start address. - * @memberof Address4 - * @instance * @returns {bigint} */ _startAddress() { - return BigInt(`0b${this.mask() + "0".repeat(constants.BITS - this.subnetMask)}`); + return BigInt(`0b${this.mask() + "0".repeat(constants3.BITS - this.subnetMask)}`); } /** * The first address in the range given by this address' subnet. * Often referred to as the Network Address. - * @memberof Address4 - * @instance * @returns {Address4} */ startAddress() { @@ -49225,8 +46367,6 @@ var require_ipv4 = __commonJS({ /** * The first host address in the range given by this address's subnet ie * the first address after the Network Address - * @memberof Address4 - * @instance * @returns {Address4} */ startAddressExclusive() { @@ -49235,18 +46375,14 @@ var require_ipv4 = __commonJS({ } /** * Helper function getting end address. - * @memberof Address4 - * @instance * @returns {bigint} */ _endAddress() { - return BigInt(`0b${this.mask() + "1".repeat(constants.BITS - this.subnetMask)}`); + return BigInt(`0b${this.mask() + "1".repeat(constants3.BITS - this.subnetMask)}`); } /** * The last address in the range given by this address' subnet * Often referred to as the Broadcast - * @memberof Address4 - * @instance * @returns {Address4} */ endAddress() { @@ -49255,8 +46391,6 @@ var require_ipv4 = __commonJS({ /** * The last host address in the range given by this address's subnet ie * the last address prior to the Broadcast Address - * @memberof Address4 - * @instance * @returns {Address4} */ endAddressExclusive() { @@ -49264,20 +46398,76 @@ var require_ipv4 = __commonJS({ return _Address4.fromBigInt(this._endAddress() - adjust); } /** - * Converts a BigInt to a v4 address object - * @memberof Address4 - * @static + * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for + * a `/20`. Returns an `Address4`; call `.correctForm()` for the string. + * @returns {Address4} + */ + subnetMaskAddress() { + return _Address4.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants3.BITS - this.subnetMask)}`)); + } + /** + * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is + * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`; + * call `.correctForm()` for the string. + * @returns {Address4} + */ + wildcardMask() { + return _Address4.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants3.BITS - this.subnetMask)}`)); + } + /** + * The network address in CIDR string form, e.g. `192.168.1.0/24` for + * `192.168.1.5/24`. For an address with no explicit subnet the prefix is + * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`. + * @returns {string} + */ + networkForm() { + return `${this.startAddress().correctForm()}/${this.subnetMask}`; + } + /** + * Converts a BigInt to a v4 address object. The value must be in the + * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. * @param {bigint} bigInt - a BigInt to convert * @returns {Address4} */ static fromBigInt(bigInt) { - return _Address4.fromHex(bigInt.toString(16)); + if (bigInt < 0n || bigInt > 0xffffffffn) { + throw new address_error_1.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1"); + } + return _Address4.fromHex(bigInt.toString(16).padStart(8, "0")); + } + /** + * Convert a byte array to an Address4 object. + * + * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`. + * @param {Array} bytes - an array of 4 bytes (0-255) + * @returns {Address4} + */ + static fromByteArray(bytes) { + if (bytes.length !== 4) { + throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); + } + for (let i5 = 0; i5 < bytes.length; i5++) { + if (!Number.isInteger(bytes[i5]) || bytes[i5] < 0 || bytes[i5] > 255) { + throw new address_error_1.AddressError("All bytes must be integers between 0 and 255"); + } + } + return this.fromUnsignedByteArray(bytes); + } + /** + * Convert an unsigned byte array to an Address4 object + * @param {Array} bytes - an array of 4 unsigned bytes (0-255) + * @returns {Address4} + */ + static fromUnsignedByteArray(bytes) { + if (bytes.length !== 4) { + throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); + } + const address = bytes.join("."); + return new _Address4(address); } /** * Returns the first n bits of the address, defaulting to the * subnet mask - * @memberof Address4 - * @instance * @returns {String} */ mask(mask) { @@ -49288,8 +46478,6 @@ var require_ipv4 = __commonJS({ } /** * Returns the bits in the given range as a base-2 string - * @memberof Address4 - * @instance * @returns {string} */ getBitsBase2(start, end) { @@ -49297,10 +46485,8 @@ var require_ipv4 = __commonJS({ } /** * Return the reversed ip6.arpa form of the address - * @memberof Address4 * @param {Object} options * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix - * @instance * @returns {String} */ reverseForm(options) { @@ -49315,21 +46501,62 @@ var require_ipv4 = __commonJS({ } /** * Returns true if the given address is a multicast address - * @memberof Address4 - * @instance * @returns {boolean} */ isMulticast() { - return this.isInSubnet(new _Address4("224.0.0.0/4")); + return this.isInSubnet(MULTICAST_V4); + } + /** + * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`). + * @returns {boolean} + */ + isPrivate() { + return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet)); + } + /** + * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)). + * @returns {boolean} + */ + isLoopback() { + return this.isInSubnet(LOOPBACK_V4); + } + /** + * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)). + * @returns {boolean} + */ + isLinkLocal() { + return this.isInSubnet(LINK_LOCAL_V4); + } + /** + * Returns true if the address is the unspecified address `0.0.0.0`. + * @returns {boolean} + */ + isUnspecified() { + return this.isInSubnet(UNSPECIFIED_V4); + } + /** + * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)). + * @returns {boolean} + */ + isBroadcast() { + return this.isInSubnet(BROADCAST_V4); + } + /** + * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)). + * @returns {boolean} + */ + isCGNAT() { + return this.isInSubnet(CGNAT_V4); } /** * Returns a zero-padded base-2 string representation of the address - * @memberof Address4 - * @instance * @returns {string} */ binaryZeroPad() { - return this.bigInt().toString(2).padStart(constants.BITS, "0"); + if (this._binaryZeroPad === void 0) { + this._binaryZeroPad = this.bigInt().toString(2).padStart(constants3.BITS, "0"); + } + return this._binaryZeroPad; } /** * Groups an IPv4 address for inclusion at the end of an IPv6 address @@ -49337,10 +46564,21 @@ var require_ipv4 = __commonJS({ */ groupForV6() { const segments = this.parsedAddress; - return this.address.replace(constants.RE_ADDRESS, `${segments.slice(0, 2).join(".")}.${segments.slice(2, 4).join(".")}`); + return this.address.replace(constants3.RE_ADDRESS, `${segments.slice(0, 2).join(".")}.${segments.slice(2, 4).join(".")}`); } }; exports2.Address4 = Address4; + var MULTICAST_V4 = new Address4("224.0.0.0/4"); + var PRIVATE_V4 = [ + new Address4("10.0.0.0/8"), + new Address4("172.16.0.0/12"), + new Address4("192.168.0.0/16") + ]; + var LOOPBACK_V4 = new Address4("127.0.0.0/8"); + var LINK_LOCAL_V4 = new Address4("169.254.0.0/16"); + var UNSPECIFIED_V4 = new Address4("0.0.0.0/32"); + var BROADCAST_V4 = new Address4("255.255.255.255/32"); + var CGNAT_V4 = new Address4("100.64.0.0/10"); } }); @@ -49384,7 +46622,12 @@ var require_constants8 = __commonJS({ "::/128": "Unspecified", "::1/128": "Loopback", "ff00::/8": "Multicast", - "fe80::/10": "Link-local unicast" + "fe80::/10": "Link-local unicast", + "fc00::/7": "Unique local", + "2002::/16": "6to4", + "2001:db8::/32": "Documentation", + "64:ff9b::/96": "NAT64 (well-known)", + "64:ff9b:1::/48": "NAT64 (local-use)" }; exports2.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi; exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi; @@ -49400,19 +46643,23 @@ var require_helpers = __commonJS({ "node_modules/ip-address/dist/v6/helpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.escapeHtml = escapeHtml; exports2.spanAllZeroes = spanAllZeroes; exports2.spanAll = spanAll; exports2.spanLeadingZeroes = spanLeadingZeroes; exports2.simpleGroup = simpleGroup; + function escapeHtml(s) { + return s.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + } function spanAllZeroes(s) { - return s.replace(/(0+)/g, '$1'); + return escapeHtml(s).replace(/(0+)/g, '$1'); } function spanAll(s, offset = 0) { const letters = s.split(""); - return letters.map((n3, i5) => `${spanAllZeroes(n3)}`).join(""); + return letters.map((n3, i5) => `${spanAllZeroes(n3)}`).join(""); } function spanLeadingZeroesSimple(group) { - return group.replace(/^(0+)/, '$1'); + return escapeHtml(group).replace(/^(0+)/, '$1'); } function spanLeadingZeroes(address) { const groups = address.split(":"); @@ -49563,6 +46810,7 @@ var require_ipv6 = __commonJS({ var regular_expressions_1 = require_regular_expressions(); var address_error_1 = require_address_error(); var common_1 = require_common2(); + var isCorrect6 = common.isCorrect(constants6.BITS); function assert4(condition) { if (!condition) { throw new Error("Assertion failed."); @@ -49608,7 +46856,7 @@ var require_ipv6 = __commonJS({ this.v4 = false; this.zone = ""; this.isInSubnet = common.isInSubnet; - this.isCorrect = common.isCorrect(constants6.BITS); + this.isCorrect = isCorrect6; if (optionalGroups === void 0) { this.groups = constants6.GROUPS; } else { @@ -49635,6 +46883,13 @@ var require_ipv6 = __commonJS({ this.addressMinusSuffix = address; this.parsedAddress = this.parse(this.addressMinusSuffix); } + /** + * Returns true if the given string is a valid IPv6 address (with optional + * CIDR subnet and zone identifier), false otherwise. Host bits in the + * subnet portion are allowed (e.g. `2001:db8::1/32` is valid); for strict + * network-address validation compare `correctForm()` to + * `startAddress().correctForm()`, or use `networkForm()`. + */ static isValid(address) { try { new _Address6(address); @@ -49644,9 +46899,8 @@ var require_ipv6 = __commonJS({ } } /** - * Convert a BigInt to a v6 address object - * @memberof Address6 - * @static + * Convert a BigInt to a v6 address object. The value must be in the + * range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown. * @param {bigint} bigInt - a BigInt to convert * @returns {Address6} * @example @@ -49655,19 +46909,21 @@ var require_ipv6 = __commonJS({ * address.correctForm(); // '::e8:d4a5:1000' */ static fromBigInt(bigInt) { + if (bigInt < 0n || bigInt > (1n << BigInt(constants6.BITS)) - 1n) { + throw new address_error_1.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1"); + } const hex = bigInt.toString(16).padStart(32, "0"); const groups = []; - let i5; - for (i5 = 0; i5 < constants6.GROUPS; i5++) { + for (let i5 = 0; i5 < constants6.GROUPS; i5++) { groups.push(hex.slice(i5 * 4, (i5 + 1) * 4)); } return new _Address6(groups.join(":")); } /** - * Convert a URL (with optional port number) to an address object - * @memberof Address6 - * @static - * @param {string} url - a URL with optional port number + * Parse a URL (with optional bracketed host and port) into an address and + * port. Returns either `{ address, port }` on success or + * `{ error, address: null, port: null }` if the URL could not be parsed. + * Ports are returned as numbers (or `null` if absent or out of range). * @example * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); * addressAndPort.address.correctForm(); // 'ffff::' @@ -49715,10 +46971,89 @@ var require_ipv6 = __commonJS({ port }; } + /** + * Construct an `Address6` from an address and a hex subnet mask given as + * separate strings (e.g. as returned by Node's `os.networkInterfaces()`). + * Throws `AddressError` if the mask is non-contiguous (e.g. + * `ffff::ffff`). + * @example + * var address = Address6.fromAddressAndMask('fe80::1', 'ffff:ffff:ffff:ffff::'); + * address.subnetMask; // 64 + */ + static fromAddressAndMask(address, mask) { + const bits = common.prefixLengthFromMask(new _Address6(mask).bigInt(), constants6.BITS); + return new _Address6(`${address}/${bits}`); + } + /** + * Construct an `Address6` from an address and a Cisco-style wildcard mask + * given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`). + * The wildcard mask is the bitwise inverse of the subnet mask. Throws + * `AddressError` if the mask is non-contiguous. + * @example + * var address = Address6.fromAddressAndWildcardMask('fe80::1', '::ffff:ffff:ffff:ffff'); + * address.subnetMask; // 64 + */ + static fromAddressAndWildcardMask(address, wildcardMask) { + const wildcard = new _Address6(wildcardMask).bigInt(); + const allOnes = (BigInt(1) << BigInt(constants6.BITS)) - BigInt(1); + const mask = wildcard ^ allOnes; + const bits = common.prefixLengthFromMask(mask, constants6.BITS); + return new _Address6(`${address}/${bits}`); + } + /** + * Construct an `Address6` from a wildcard pattern with trailing `*` + * groups. The number of trailing wildcards determines the prefix + * length: each `*` represents 16 bits. `::` is expanded to zero groups + * (not wildcards) before evaluating trailing wildcards. + * + * Only trailing whole-group wildcards are supported. Partial-group + * wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g. + * `*::1`) throw `AddressError`. + * @example + * Address6.fromWildcard('2001:db8:*:*:*:*:*:*').subnet; // '/32' + * Address6.fromWildcard('2001:db8::*').subnet; // '/112' + * Address6.fromWildcard('*:*:*:*:*:*:*:*').subnet; // '/0' + */ + static fromWildcard(input) { + if (input.includes("%") || input.includes("/")) { + throw new address_error_1.AddressError("Wildcard pattern must not include a zone or CIDR suffix"); + } + const halves = input.split("::"); + if (halves.length > 2) { + throw new address_error_1.AddressError("Wildcard pattern cannot contain more than one '::'"); + } + let groups; + if (halves.length === 2) { + const left = halves[0] === "" ? [] : halves[0].split(":"); + const right = halves[1] === "" ? [] : halves[1].split(":"); + const remaining = constants6.GROUPS - left.length - right.length; + if (remaining < 1) { + throw new address_error_1.AddressError("Wildcard pattern with '::' has too many groups"); + } + groups = [...left, ...new Array(remaining).fill("0"), ...right]; + } else { + groups = input.split(":"); + } + if (groups.length !== constants6.GROUPS) { + throw new address_error_1.AddressError("Wildcard pattern must have 8 groups"); + } + let firstWildcard = -1; + for (let i5 = 0; i5 < groups.length; i5++) { + if (groups[i5] === "*") { + if (firstWildcard === -1) { + firstWildcard = i5; + } + } else if (firstWildcard !== -1) { + throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)"); + } + } + const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard; + const replaced = groups.map((g5) => g5 === "*" ? "0" : g5); + const subnetBits = constants6.BITS - trailing * 16; + return new _Address6(`${replaced.join(":")}/${subnetBits}`); + } /** * Create an IPv6-mapped address given an IPv4 address - * @memberof Address6 - * @static * @param {string} address - An IPv4 address string * @returns {Address6} * @example @@ -49733,8 +47068,6 @@ var require_ipv6 = __commonJS({ } /** * Return an address from ip6.arpa form - * @memberof Address6 - * @static * @param {string} arpaFormAddress - an 'ip6.arpa' form address * @returns {Adress6} * @example @@ -49757,8 +47090,6 @@ var require_ipv6 = __commonJS({ } /** * Return the Microsoft UNC transcription of the address - * @memberof Address6 - * @instance * @returns {String} the Microsoft UNC transcription of the address */ microsoftTranscription() { @@ -49766,8 +47097,6 @@ var require_ipv6 = __commonJS({ } /** * Return the first n bits of the address, defaulting to the subnet mask - * @memberof Address6 - * @instance * @param {number} [mask=subnet] - the number of bits to mask * @returns {String} the first n bits of the address as a string */ @@ -49776,8 +47105,6 @@ var require_ipv6 = __commonJS({ } /** * Return the number of possible subnets of a given size in the address - * @memberof Address6 - * @instance * @param {number} [subnetSize=128] - the subnet size * @returns {String} */ @@ -49793,8 +47120,6 @@ var require_ipv6 = __commonJS({ } /** * Helper function getting start address. - * @memberof Address6 - * @instance * @returns {bigint} */ _startAddress() { @@ -49803,8 +47128,6 @@ var require_ipv6 = __commonJS({ /** * The first address in the range given by this address' subnet * Often referred to as the Network Address. - * @memberof Address6 - * @instance * @returns {Address6} */ startAddress() { @@ -49813,8 +47136,6 @@ var require_ipv6 = __commonJS({ /** * The first host address in the range given by this address's subnet ie * the first address after the Network Address - * @memberof Address6 - * @instance * @returns {Address6} */ startAddressExclusive() { @@ -49823,8 +47144,6 @@ var require_ipv6 = __commonJS({ } /** * Helper function getting end address. - * @memberof Address6 - * @instance * @returns {bigint} */ _endAddress() { @@ -49833,8 +47152,6 @@ var require_ipv6 = __commonJS({ /** * The last address in the range given by this address' subnet * Often referred to as the Broadcast - * @memberof Address6 - * @instance * @returns {Address6} */ endAddress() { @@ -49843,8 +47160,6 @@ var require_ipv6 = __commonJS({ /** * The last host address in the range given by this address's subnet ie * the last address prior to the Broadcast Address - * @memberof Address6 - * @instance * @returns {Address6} */ endAddressExclusive() { @@ -49852,36 +47167,69 @@ var require_ipv6 = __commonJS({ return _Address6.fromBigInt(this._endAddress() - adjust); } /** - * Return the scope of the address - * @memberof Address6 - * @instance + * The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a + * `/64`. Returns an `Address6`; call `.correctForm()` for the string. + * @returns {Address6} + */ + subnetMaskAddress() { + return _Address6.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants6.BITS - this.subnetMask)}`)); + } + /** + * The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a + * `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns + * an `Address6`; call `.correctForm()` for the string. + * @returns {Address6} + */ + wildcardMask() { + return _Address6.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants6.BITS - this.subnetMask)}`)); + } + /** + * The network address in CIDR string form, e.g. `2001:db8::/32` for + * `2001:db8::1/32`. For an address with no explicit subnet the prefix + * is `/128`, e.g. `networkForm()` on `2001:db8::1` returns + * `2001:db8::1/128`. + * @returns {string} + */ + networkForm() { + return `${this.startAddress().correctForm()}/${this.subnetMask}`; + } + /** + * Return the scope of the address. The 4-bit scope field + * ([RFC 4291 §2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7)) + * is only defined for multicast addresses; for unicast addresses the scope + * is derived from the address type per + * [RFC 4007 §6](https://datatracker.ietf.org/doc/html/rfc4007#section-6). * @returns {String} */ getScope() { - let scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; - if (this.getType() === "Global unicast" && scope !== "Link local") { - scope = "Global"; + const type = this.getType(); + if (type === "Multicast" || type.startsWith("Multicast ")) { + const scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; + return scope || "Unknown"; } - return scope || "Unknown"; + if (type === "Link-local unicast" || type === "Loopback") { + return "Link local"; + } + if (type === "Unspecified") { + return "Unknown"; + } + return "Global"; } /** * Return the type of the address - * @memberof Address6 - * @instance * @returns {String} */ getType() { - for (const subnet of Object.keys(constants6.TYPES)) { - if (this.isInSubnet(new _Address6(subnet))) { - return constants6.TYPES[subnet]; + for (let i5 = 0; i5 < TYPE_SUBNETS.length; i5++) { + const entry = TYPE_SUBNETS[i5]; + if (this.isInSubnet(entry[0])) { + return entry[1]; } } return "Global unicast"; } /** * Return the bits in the given range as a BigInt - * @memberof Address6 - * @instance * @returns {bigint} */ getBits(start, end) { @@ -49889,8 +47237,6 @@ var require_ipv6 = __commonJS({ } /** * Return the bits in the given range as a base-2 string - * @memberof Address6 - * @instance * @returns {String} */ getBitsBase2(start, end) { @@ -49898,8 +47244,6 @@ var require_ipv6 = __commonJS({ } /** * Return the bits in the given range as a base-16 string - * @memberof Address6 - * @instance * @returns {String} */ getBitsBase16(start, end) { @@ -49911,8 +47255,6 @@ var require_ipv6 = __commonJS({ } /** * Return the bits that are set past the subnet mask length - * @memberof Address6 - * @instance * @returns {String} */ getBitsPastSubnet() { @@ -49920,10 +47262,8 @@ var require_ipv6 = __commonJS({ } /** * Return the reversed ip6.arpa form of the address - * @memberof Address6 * @param {Object} options * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix - * @instance * @returns {String} */ reverseForm(options) { @@ -49944,10 +47284,10 @@ var require_ipv6 = __commonJS({ return "ip6.arpa."; } /** - * Return the correct form of the address - * @memberof Address6 - * @instance - * @returns {String} + * Returns the address in correct form, per + * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros + * stripped, the longest run of zero groups collapsed to `::`, and hex digits + * lowercased (e.g. `2001:db8::1`). This is the recommended form for display. */ correctForm() { let i5; @@ -49989,8 +47329,6 @@ var require_ipv6 = __commonJS({ } /** * Return a zero-padded base-2 string representation of the address - * @memberof Address6 - * @instance * @returns {String} * @example * var address = new Address6('2001:4860:4001:803::1011'); @@ -49999,10 +47337,22 @@ var require_ipv6 = __commonJS({ * // 0000000000000000000000000000000000000000000000000001000000010001' */ binaryZeroPad() { - return this.bigInt().toString(2).padStart(constants6.BITS, "0"); + if (this._binaryZeroPad === void 0) { + this._binaryZeroPad = this.bigInt().toString(2).padStart(constants6.BITS, "0"); + } + return this._binaryZeroPad; } + /** + * Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the + * trailing IPv4 address into `this.address4` / `this.parsedAddress4` and + * returning the address with the v4 portion converted to two v6 groups. + * Used internally by `parse()`. + */ // TODO: Improve the semantics of this helper function parse4in6(address) { + if (address.indexOf(".") === -1) { + return address; + } const groups = address.split(":"); const lastGroup = groups.slice(-1)[0]; const address4 = lastGroup.match(constants4.RE_ADDRESS); @@ -50011,7 +47361,10 @@ var require_ipv6 = __commonJS({ this.address4 = new ipv4_1.Address4(this.parsedAddress4); for (let i5 = 0; i5 < this.address4.groups; i5++) { if (/^0[0-9]+/.test(this.address4.parsedAddress[i5])) { - throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", address.replace(constants4.RE_ADDRESS, this.address4.parsedAddress.map(spanLeadingZeroes4).join("."))); + const highlighted = this.address4.parsedAddress.map(spanLeadingZeroes4).join("."); + const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":"); + const separator = groups.length > 1 ? ":" : ""; + throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`); } } this.v4 = true; @@ -50020,6 +47373,13 @@ var require_ipv6 = __commonJS({ } return address; } + /** + * Parses an IPv6 address string into its 8 hexadecimal groups (expanding + * any `::` elision and any trailing v4-in-v6 portion) and stores the result + * on `this.parsedAddress`. Called automatically by the constructor; you + * typically don't need to call it directly. Throws `AddressError` if the + * input is malformed. + */ // TODO: Make private? parse(address) { address = this.parse4in6(address); @@ -50067,18 +47427,16 @@ var require_ipv6 = __commonJS({ return groups; } /** - * Return the canonical form of the address - * @memberof Address6 - * @instance - * @returns {String} + * Returns the canonical (fully expanded) form of the address: all 8 groups, + * each padded to 4 hex digits, with no `::` collapsing + * (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and + * byte-exact comparison. */ canonicalForm() { return this.parsedAddress.map(paddedHex).join(":"); } /** * Return the decimal form of the address - * @memberof Address6 - * @instance * @returns {String} */ decimal() { @@ -50086,8 +47444,6 @@ var require_ipv6 = __commonJS({ } /** * Return the address as a BigInt - * @memberof Address6 - * @instance * @returns {bigint} */ bigInt() { @@ -50095,8 +47451,6 @@ var require_ipv6 = __commonJS({ } /** * Return the last two groups of this address as an IPv4 address string - * @memberof Address6 - * @instance * @returns {Address4} * @example * var address = new Address6('2001:4860:4001::1825:bf11'); @@ -50104,12 +47458,10 @@ var require_ipv6 = __commonJS({ */ to4() { const binary = this.binaryZeroPad().split(""); - return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16)); + return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0")); } /** * Return the v4-in-v6 form of the address - * @memberof Address6 - * @instance * @returns {String} */ to4in6() { @@ -50123,10 +47475,10 @@ var require_ipv6 = __commonJS({ return correct + infix + address4.address; } /** - * Return an object containing the Teredo properties of the address - * @memberof Address6 - * @instance - * @returns {Object} + * Decodes the Teredo tunneling fields embedded in this address. Returns the + * Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, + * UDP port, and Microsoft-format flag breakdown (reserved, universal/local, + * group/individual, nonce). Only meaningful for addresses in `2001::/32`. */ inspectTeredo() { const prefix = this.getBitsBase16(0, 32); @@ -50134,7 +47486,7 @@ var require_ipv6 = __commonJS({ const udpPort = (bitsForUdpPort ^ BigInt("0xffff")).toString(); const server4 = ipv4_1.Address4.fromHex(this.getBitsBase16(32, 64)); const bitsForClient4 = this.getBits(96, 128); - const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16)); + const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16).padStart(8, "0")); const flagsBase2 = this.getBitsBase2(64, 80); const coneNat = (0, common_1.testBit)(flagsBase2, 15); const reserved = (0, common_1.testBit)(flagsBase2, 14); @@ -50157,10 +47509,9 @@ var require_ipv6 = __commonJS({ }; } /** - * Return an object containing the 6to4 properties of the address - * @memberof Address6 - * @instance - * @returns {Object} + * Decodes the 6to4 tunneling fields embedded in this address. Returns the + * 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for + * addresses in `2002::/16`. */ inspect6to4() { const prefix = this.getBitsBase16(0, 16); @@ -50172,8 +47523,6 @@ var require_ipv6 = __commonJS({ } /** * Return a v6 6to4 address from a v6 v4inv6 address - * @memberof Address6 - * @instance * @returns {Address6} */ to6to4() { @@ -50190,9 +47539,73 @@ var require_ipv6 = __commonJS({ return new _Address6(addr6to4); } /** - * Return a byte array - * @memberof Address6 - * @instance + * Embed an IPv4 address into a NAT64 IPv6 address using the encoding + * defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). + * The default prefix is the well-known prefix `64:ff9b::/96`. The prefix + * length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter + * than /64 the IPv4 octets are split around the reserved bits 64–71. + * @example + * Address6.fromAddress4Nat64('192.0.2.33').correctForm(); // '64:ff9b::c000:221' + * Address6.fromAddress4Nat64('192.0.2.33', '2001:db8::/32').correctForm(); // '2001:db8:c000:221::' + */ + static fromAddress4Nat64(address, prefix = "64:ff9b::/96") { + const v4 = new ipv4_1.Address4(address); + const prefix6 = new _Address6(prefix); + const pl = prefix6.subnetMask; + if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) { + throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96"); + } + const prefixBits = prefix6.binaryZeroPad(); + const v4Bits = v4.binaryZeroPad(); + let bits; + if (pl === 96) { + bits = prefixBits.slice(0, 96) + v4Bits; + } else { + const beforeU = 64 - pl; + bits = prefixBits.slice(0, pl) + v4Bits.slice(0, beforeU) + "00000000" + v4Bits.slice(beforeU) + "0".repeat(128 - 72 - (32 - beforeU)); + } + const hex = BigInt(`0b${bits}`).toString(16).padStart(32, "0"); + const groups = []; + for (let i5 = 0; i5 < 8; i5++) { + groups.push(hex.slice(i5 * 4, (i5 + 1) * 4)); + } + return new _Address6(groups.join(":")); + } + /** + * Extract the embedded IPv4 address from a NAT64 IPv6 address using the + * encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). + * The default prefix is the well-known prefix `64:ff9b::/96`. Returns + * `null` if this address is not contained within the given prefix. + * @example + * new Address6('64:ff9b::c000:221').toAddress4Nat64()!.correctForm(); // '192.0.2.33' + */ + toAddress4Nat64(prefix = "64:ff9b::/96") { + const prefix6 = new _Address6(prefix); + const pl = prefix6.subnetMask; + if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) { + throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96"); + } + if (!this.isInSubnet(prefix6)) { + return null; + } + const bits = this.binaryZeroPad(); + let v4Bits; + if (pl === 96) { + v4Bits = bits.slice(96, 128); + } else { + const beforeU = 64 - pl; + v4Bits = bits.slice(pl, pl + beforeU) + bits.slice(72, 72 + (32 - beforeU)); + } + const octets = []; + for (let i5 = 0; i5 < 4; i5++) { + octets.push(parseInt(v4Bits.slice(i5 * 8, (i5 + 1) * 8), 2).toString()); + } + return new ipv4_1.Address4(octets.join(".")); + } + /** + * Return a byte array. + * + * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. * @returns {Array} */ toByteArray() { @@ -50206,27 +47619,27 @@ var require_ipv6 = __commonJS({ return bytes; } /** - * Return an unsigned byte array - * @memberof Address6 - * @instance + * Return an unsigned byte array. + * + * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. * @returns {Array} */ toUnsignedByteArray() { return this.toByteArray().map(unsignByte); } /** - * Convert a byte array to an Address6 object - * @memberof Address6 - * @static + * Convert a byte array to an Address6 object. + * + * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. * @returns {Address6} */ static fromByteArray(bytes) { return this.fromUnsignedByteArray(bytes.map(unsignByte)); } /** - * Convert an unsigned byte array to an Address6 object - * @memberof Address6 - * @static + * Convert an unsigned byte array to an Address6 object. + * + * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. * @returns {Address6} */ static fromUnsignedByteArray(bytes) { @@ -50241,8 +47654,6 @@ var require_ipv6 = __commonJS({ } /** * Returns true if the address is in the canonical form, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ isCanonical() { @@ -50250,8 +47661,6 @@ var require_ipv6 = __commonJS({ } /** * Returns true if the address is a link local address, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ isLinkLocal() { @@ -50262,53 +47671,81 @@ var require_ipv6 = __commonJS({ } /** * Returns true if the address is a multicast address, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ isMulticast() { - return this.getType() === "Multicast"; + const type = this.getType(); + return type === "Multicast" || type.startsWith("Multicast "); } /** - * Returns true if the address is a v4-in-v6 address, false otherwise - * @memberof Address6 - * @instance + * Returns true if the address was written in v4-in-v6 dotted-quad notation + * (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag + * and does not reflect whether the address bits lie in the IPv4-mapped + * (`::ffff:0:0/96`) subnet — for that, see {@link isMapped4}. * @returns {boolean} */ is4() { return this.v4; } + /** + * Returns true if the address is an IPv4-mapped IPv6 address in + * `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), + * false otherwise. Unlike {@link is4}, this checks the underlying address + * bits rather than the textual notation, so `::ffff:127.0.0.1` and + * `::ffff:7f00:1` both return true. + * @returns {boolean} + */ + isMapped4() { + return this.isInSubnet(IPV4_MAPPED_SUBNET); + } /** * Returns true if the address is a Teredo address, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ isTeredo() { - return this.isInSubnet(new _Address6("2001::/32")); + return this.isInSubnet(TEREDO_SUBNET); } /** * Returns true if the address is a 6to4 address, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ is6to4() { - return this.isInSubnet(new _Address6("2002::/16")); + return this.isInSubnet(SIX_TO_FOUR_SUBNET); } /** * Returns true if the address is a loopback address, false otherwise - * @memberof Address6 - * @instance * @returns {boolean} */ isLoopback() { return this.getType() === "Loopback"; } + /** + * Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. + * @returns {boolean} + */ + isULA() { + return this.isInSubnet(ULA_SUBNET); + } + /** + * Returns true if the address is the unspecified address `::`. + * @returns {boolean} + */ + isUnspecified() { + return this.getType() === "Unspecified"; + } + /** + * Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). + * @returns {boolean} + */ + isDocumentation() { + return this.isInSubnet(DOCUMENTATION_SUBNET); + } // #endregion // #region HTML /** - * @returns {String} the address in link form with a default port of 80 + * Returns the address as an HTTP URL with the host bracketed, e.g. + * `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, + * e.g. `http://[2001:db8::1]:8080/`. */ href(optionalPort) { if (optionalPort === void 0) { @@ -50319,7 +47756,12 @@ var require_ipv6 = __commonJS({ return `http://[${this.correctForm()}]${optionalPort}/`; } /** - * @returns {String} a link suitable for conveying the address via a URL hash + * Returns an HTML `` element whose `href` encodes the address in a URL + * hash fragment (default prefix `/#address=`). Useful for linking between + * pages of an address-inspector UI. + * @param options.className - CSS class for the rendered `` element + * @param options.prefix - hash prefix prepended to the address (default `/#address=`) + * @param options.v4 - when true, render the address in v4-in-v6 form */ link(options) { if (!options) { @@ -50339,10 +47781,13 @@ var require_ipv6 = __commonJS({ formFunction = this.to4in6; } const form = formFunction.call(this); + const safeHref = helpers.escapeHtml(`${options.prefix}${form}`); + const safeForm = helpers.escapeHtml(form); if (options.className) { - return `${form}`; + const safeClass = helpers.escapeHtml(options.className); + return `${safeForm}`; } - return `${form}`; + return `${safeForm}`; } /** * Groups an address @@ -50350,12 +47795,12 @@ var require_ipv6 = __commonJS({ */ group() { if (this.elidedGroups === 0) { - return helpers.simpleGroup(this.address).join(":"); + return helpers.simpleGroup(this.addressMinusSuffix).join(":"); } assert4(typeof this.elidedGroups === "number"); assert4(typeof this.elisionBegin === "number"); const output = []; - const [left, right] = this.address.split("::"); + const [left, right] = this.addressMinusSuffix.split("::"); if (left.length) { output.push(...helpers.simpleGroup(left)); } else { @@ -50383,8 +47828,6 @@ var require_ipv6 = __commonJS({ /** * Generate a regular expression string that can be used to find or validate * all variations of this address - * @memberof Address6 - * @instance * @param {boolean} substringSearch * @returns {string} */ @@ -50423,8 +47866,6 @@ var require_ipv6 = __commonJS({ /** * Generate a regular expression that can be used to find or validate all * variations of this address. - * @memberof Address6 - * @instance * @param {boolean} substringSearch * @returns {RegExp} */ @@ -50433,6 +47874,15 @@ var require_ipv6 = __commonJS({ } }; exports2.Address6 = Address6; + var TYPE_SUBNETS = Object.keys(constants6.TYPES).map((subnet) => [ + new Address6(subnet), + constants6.TYPES[subnet] + ]); + var TEREDO_SUBNET = new Address6("2001::/32"); + var SIX_TO_FOUR_SUBNET = new Address6("2002::/16"); + var ULA_SUBNET = new Address6("fc00::/7"); + var DOCUMENTATION_SUBNET = new Address6("2001:db8::/32"); + var IPV4_MAPPED_SUBNET = new Address6("::ffff:0:0/96"); } }); @@ -50645,7 +48095,7 @@ var require_receivebuffer = __commonJS({ var require_socksclient = __commonJS({ "node_modules/socks/build/client/socksclient.js"(exports2) { "use strict"; - var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter7 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); @@ -50714,13 +48164,13 @@ var require_socksclient = __commonJS({ } const client = new _SocksClient(options); client.connect(options.existing_socket); - client.once("established", (info5) => { + client.once("established", (info2) => { client.removeAllListeners(); if (typeof callback === "function") { - callback(null, info5); - resolve(info5); + callback(null, info2); + resolve(info2); } else { - resolve(info5); + resolve(info2); } }); client.once("error", (err) => { @@ -50744,7 +48194,7 @@ var require_socksclient = __commonJS({ * @returns { Promise } */ static createConnectionChain(options, callback) { - return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter7(this, void 0, void 0, function* () { try { (0, helpers_1.validateSocksClientChainOptions)(options); } catch (err) { @@ -50880,13 +48330,13 @@ var require_socksclient = __commonJS({ this.socket.setNoDelay(!!this.options.set_tcp_nodelay); } } - this.prependOnceListener("established", (info5) => { + this.prependOnceListener("established", (info2) => { setImmediate(() => { if (this.receiveBuffer.length > 0) { const excessData = this.receiveBuffer.get(this.receiveBuffer.length); - info5.socket.emit("data", excessData); + info2.socket.emit("data", excessData); } - info5.socket.resume(); + info2.socket.resume(); }); }); } @@ -51122,24 +48572,24 @@ var require_socksclient = __commonJS({ this.setState(constants_1.SocksClientState.SentAuthentication); } sendSocks5CustomAuthentication() { - return __awaiter2(this, void 0, void 0, function* () { + return __awaiter7(this, void 0, void 0, function* () { this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size; this.socket.write(yield this.options.proxy.custom_auth_request_handler()); this.setState(constants_1.SocksClientState.SentAuthentication); }); } handleSocks5CustomAuthHandshakeResponse(data3) { - return __awaiter2(this, void 0, void 0, function* () { + return __awaiter7(this, void 0, void 0, function* () { return yield this.options.proxy.custom_auth_response_handler(data3); }); } handleSocks5AuthenticationNoAuthHandshakeResponse(data3) { - return __awaiter2(this, void 0, void 0, function* () { + return __awaiter7(this, void 0, void 0, function* () { return data3[1] === 0; }); } handleSocks5AuthenticationUserPassHandshakeResponse(data3) { - return __awaiter2(this, void 0, void 0, function* () { + return __awaiter7(this, void 0, void 0, function* () { return data3[1] === 0; }); } @@ -51148,7 +48598,7 @@ var require_socksclient = __commonJS({ * @param data */ handleInitialSocks5AuthenticationHandshakeResponse() { - return __awaiter2(this, void 0, void 0, function* () { + return __awaiter7(this, void 0, void 0, function* () { this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); let authResult = false; if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { @@ -51407,7 +48857,7 @@ function omit3(obj, ...keys) { } return ret; } -var import_socks, import_debug4, dns, net4, tls3, import_url3, debug6, setServernameFromNonIpHost2, SocksProxyAgent; +var import_socks, import_debug4, dns, net4, tls3, import_url3, debug5, setServernameFromNonIpHost2, SocksProxyAgent; var init_dist4 = __esm({ "node_modules/proxy-agent/node_modules/socks-proxy-agent/dist/index.js"() { import_socks = __toESM(require_build(), 1); @@ -51417,7 +48867,7 @@ var init_dist4 = __esm({ net4 = __toESM(require("net"), 1); tls3 = __toESM(require("tls"), 1); import_url3 = require("url"); - debug6 = (0, import_debug4.default)("socks-proxy-agent"); + debug5 = (0, import_debug4.default)("socks-proxy-agent"); setServernameFromNonIpHost2 = (options) => { if (options.servername === void 0 && options.host && !net4.isIP(options.host)) { return { @@ -51427,7 +48877,7 @@ var init_dist4 = __esm({ } return options; }; - SocksProxyAgent = class extends Agent2 { + SocksProxyAgent = class extends Agent4 { constructor(uri, opts) { super(opts); const url = typeof uri === "string" ? new import_url3.URL(uri) : uri; @@ -51477,21 +48927,21 @@ var init_dist4 = __esm({ if (tlsSocket) tlsSocket.destroy(); }; - debug6("Creating socks proxy connection: %o", socksOpts); + debug5("Creating socks proxy connection: %o", socksOpts); const { socket } = await import_socks.SocksClient.createConnection(socksOpts); - debug6("Successfully created socks proxy connection"); + debug5("Successfully created socks proxy connection"); if (timeout !== null) { socket.setTimeout(timeout); socket.on("timeout", () => cleanup()); } if (opts.secureEndpoint) { - debug6("Upgrading socket connection to TLS"); + debug5("Upgrading socket connection to TLS"); const tlsSocket = tls3.connect({ ...omit3(setServernameFromNonIpHost2(opts), "host", "path", "port"), socket }); - tlsSocket.once("error", (error2) => { - debug6("Socket TLS error", error2.message); + tlsSocket.once("error", (error3) => { + debug5("Socket TLS error", error3.message); cleanup(tlsSocket); }); return tlsSocket; @@ -51525,15 +48975,15 @@ var init_helpers2 = __esm({ }); // node_modules/pac-proxy-agent/node_modules/agent-base/dist/index.js -var net5, http2, import_https2, INTERNAL2, Agent4; +var net5, http3, import_https2, INTERNAL2, Agent6; var init_dist5 = __esm({ "node_modules/pac-proxy-agent/node_modules/agent-base/dist/index.js"() { net5 = __toESM(require("net"), 1); - http2 = __toESM(require("http"), 1); + http3 = __toESM(require("http"), 1); import_https2 = require("https"); init_helpers2(); INTERNAL2 = /* @__PURE__ */ Symbol("AgentBaseInternalState"); - Agent4 = class extends http2.Agent { + Agent6 = class extends http3.Agent { constructor(opts) { super(opts); this[INTERNAL2] = {}; @@ -51733,7 +49183,7 @@ var init_notmodified = __esm({ }); // node_modules/get-uri/dist/data.js -var import_debug5, import_stream, import_crypto, debug7, DataReadable, data2; +var import_debug5, import_stream, import_crypto, debug6, DataReadable, data2; var init_data = __esm({ "node_modules/get-uri/dist/data.js"() { import_debug5 = __toESM(require_src(), 1); @@ -51741,7 +49191,7 @@ var init_data = __esm({ import_crypto = require("crypto"); init_node(); init_notmodified(); - debug7 = (0, import_debug5.default)("get-uri:data"); + debug6 = (0, import_debug5.default)("get-uri:data"); DataReadable = class extends import_stream.Readable { constructor(hash, buf) { super(); @@ -51754,12 +49204,12 @@ var init_data = __esm({ const shasum = (0, import_crypto.createHash)("sha1"); shasum.update(uri); const hash = shasum.digest("hex"); - debug7('generated SHA1 hash for "data:" URI: %o', hash); + debug6('generated SHA1 hash for "data:" URI: %o', hash); if (cache5?.hash === hash) { - debug7("got matching cache SHA1 hash: %o", hash); + debug6("got matching cache SHA1 hash: %o", hash); throw new NotModifiedError(); } else { - debug7('creating Readable stream from "data:" URI buffer'); + debug6('creating Readable stream from "data:" URI buffer'); const { buffer } = dataUriToBuffer(uri); return new DataReadable(hash, Buffer.from(buffer)); } @@ -51784,15 +49234,15 @@ var init_notfound = __esm({ function isNotModified(prev, curr) { return +prev.mtime === +curr.mtime; } -var import_debug6, import_fs, import_url4, debug8, file; +var import_debug6, import_fs2, import_url4, debug7, file; var init_file = __esm({ "node_modules/get-uri/dist/file.js"() { import_debug6 = __toESM(require_src(), 1); - import_fs = require("fs"); + import_fs2 = require("fs"); init_notfound(); init_notmodified(); import_url4 = require("url"); - debug8 = (0, import_debug6.default)("get-uri:file"); + debug7 = (0, import_debug6.default)("get-uri:file"); file = async ({ href: uri }, opts = {}) => { const { cache: cache5, @@ -51802,19 +49252,19 @@ var init_file = __esm({ } = opts; try { const filepath = (0, import_url4.fileURLToPath)(uri); - debug8("Normalized pathname: %o", filepath); - const fdHandle = await import_fs.promises.open(filepath, flags, mode); - const stat = await fdHandle.stat(); - if (cache5 && cache5.stat && stat && isNotModified(cache5.stat, stat)) { + debug7("Normalized pathname: %o", filepath); + const fdHandle = await import_fs2.promises.open(filepath, flags, mode); + const stat2 = await fdHandle.stat(); + if (cache5 && cache5.stat && stat2 && isNotModified(cache5.stat, stat2)) { await fdHandle.close(); throw new NotModifiedError(); } - const rs = (0, import_fs.createReadStream)(filepath, { + const rs = (0, import_fs2.createReadStream)(filepath, { autoClose: true, ...opts, fd: fdHandle }); - rs.stat = stat; + rs.stat = stat2; return rs; } catch (err) { if (err.code === "ENOENT") { @@ -51896,6 +49346,7 @@ var require_FtpContext = __commonJS({ exports2.FTPError = FTPError; function doNothing() { } + var maxControlResponseLength = 2 ** 16; var FTPContext = class { /** * Instantiate an FTP context. @@ -52113,6 +49564,10 @@ Closing reason: ${this._closingError.stack}`; */ _onControlSocketData(chunk) { this.log(`< ${chunk}`); + if (this._partialResponse.length + chunk.length > maxControlResponseLength) { + this.closeWithError(new Error("FTP control response exceeded maximum allowed size")); + return; + } const completeResponse = this._partialResponse + chunk; const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse); this._partialResponse = parsed.rest; @@ -52138,9 +49593,9 @@ Closing reason: ${this._closingError.stack}`; * @protected */ _setupDefaultErrorHandlers(socket, identifier) { - socket.once("error", (error2) => { - error2.message += ` (${identifier})`; - this.closeWithError(error2); + socket.once("error", (error3) => { + error3.message += ` (${identifier})`; + this.closeWithError(error3); }); socket.once("close", (hadError) => { if (hadError) { @@ -52234,8 +49689,8 @@ var require_netUtils = __commonJS({ tlsSocket.removeAllListeners("error"); resolve(tlsSocket); } - }).once("error", (error2) => { - reject(error2); + }).once("error", (error3) => { + reject(error3); }); }); } @@ -52445,36 +49900,36 @@ var require_parseListMLSD = __commonJS({ exports2.transformList = transformList; exports2.parseMLSxDate = parseMLSxDate; var FileInfo_1 = require_FileInfo(); - function parseSize(value, info5) { - info5.size = parseInt(value, 10); + function parseSize(value, info2) { + info2.size = parseInt(value, 10); } var factHandlersByName = { "size": parseSize, // File size "sizd": parseSize, // Directory size - "unique": (value, info5) => { - info5.uniqueID = value; + "unique": (value, info2) => { + info2.uniqueID = value; }, - "modify": (value, info5) => { - info5.modifiedAt = parseMLSxDate(value); - info5.rawModifiedAt = info5.modifiedAt.toISOString(); + "modify": (value, info2) => { + info2.modifiedAt = parseMLSxDate(value); + info2.rawModifiedAt = info2.modifiedAt.toISOString(); }, - "type": (value, info5) => { + "type": (value, info2) => { if (value.startsWith("OS.unix=slink")) { - info5.type = FileInfo_1.FileType.SymbolicLink; - info5.link = value.substr(value.indexOf(":") + 1); + info2.type = FileInfo_1.FileType.SymbolicLink; + info2.link = value.substr(value.indexOf(":") + 1); return 1; } switch (value) { case "file": - info5.type = FileInfo_1.FileType.File; + info2.type = FileInfo_1.FileType.File; break; case "dir": - info5.type = FileInfo_1.FileType.Directory; + info2.type = FileInfo_1.FileType.Directory; break; case "OS.unix=symlink": - info5.type = FileInfo_1.FileType.SymbolicLink; + info2.type = FileInfo_1.FileType.SymbolicLink; break; case "cdir": // Current directory being listed @@ -52482,34 +49937,34 @@ var require_parseListMLSD = __commonJS({ return 2; // Don't include these entries in the listing default: - info5.type = FileInfo_1.FileType.Unknown; + info2.type = FileInfo_1.FileType.Unknown; } return 1; }, - "unix.mode": (value, info5) => { + "unix.mode": (value, info2) => { const digits = value.substr(-3); - info5.permissions = { + info2.permissions = { user: parseInt(digits[0], 10), group: parseInt(digits[1], 10), world: parseInt(digits[2], 10) }; }, - "unix.ownername": (value, info5) => { - info5.user = value; + "unix.ownername": (value, info2) => { + info2.user = value; }, - "unix.owner": (value, info5) => { - if (info5.user === void 0) - info5.user = value; + "unix.owner": (value, info2) => { + if (info2.user === void 0) + info2.user = value; }, get "unix.uid"() { return this["unix.owner"]; }, - "unix.groupname": (value, info5) => { - info5.group = value; + "unix.groupname": (value, info2) => { + info2.group = value; }, - "unix.group": (value, info5) => { - if (info5.group === void 0) - info5.group = value; + "unix.group": (value, info2) => { + if (info2.group === void 0) + info2.group = value; }, get "unix.gid"() { return this["unix.group"]; @@ -52539,7 +49994,7 @@ var require_parseListMLSD = __commonJS({ if (name === "" || name === "." || name === "..") { return void 0; } - const info5 = new FileInfo_1.FileInfo(name); + const info2 = new FileInfo_1.FileInfo(name); const facts = packedFacts.split(";"); for (const fact of facts) { const [factName, factValue] = splitStringOnce(fact, "="); @@ -52550,12 +50005,12 @@ var require_parseListMLSD = __commonJS({ if (!factHandler) { continue; } - const result = factHandler(factValue, info5); + const result = factHandler(factValue, info2); if (result === 2) { return void 0; } } - return info5; + return info2; } function transformList(files) { const nonLinksByID = /* @__PURE__ */ new Map(); @@ -52672,7 +50127,7 @@ var require_parseList = __commonJS({ if (!parser) { throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details."); } - const files = lines.map(parser.parseLine).filter((info5) => info5 !== void 0); + const files = lines.map(parser.parseLine).filter((info2) => info2 !== void 0); return parser.transformList(files); } } @@ -53818,7 +51273,7 @@ var require_dist = __commonJS({ }); // node_modules/get-uri/dist/ftp.js -var import_basic_ftp, import_stream2, import_path, import_debug7, debug9, ftp; +var import_basic_ftp, import_stream2, import_path, import_debug7, debug8, ftp; var init_ftp = __esm({ "node_modules/get-uri/dist/ftp.js"() { import_basic_ftp = __toESM(require_dist(), 1); @@ -53827,7 +51282,7 @@ var init_ftp = __esm({ import_debug7 = __toESM(require_src(), 1); init_notfound(); init_notmodified(); - debug9 = (0, import_debug7.default)("get-uri:ftp"); + debug8 = (0, import_debug7.default)("get-uri:ftp"); ftp = async (url, opts = {}) => { const { cache: cache5 } = opts; const filepath = decodeURIComponent(url.pathname); @@ -53873,7 +51328,7 @@ var init_ftp = __esm({ const stream = new import_stream2.PassThrough(); const rs = stream; client.downloadTo(stream, filepath).then((result) => { - debug9(result.message); + debug8(result.message); client.close(); }); rs.lastModified = lastModified; @@ -53913,7 +51368,7 @@ function isFresh(cache5) { let expires = parseInt(cache5.headers.expires || "", 10); const cacheControl = cache5.headers["cache-control"]; if (cacheControl) { - debug10("Cache-Control: %o", cacheControl); + debug9("Cache-Control: %o", cacheControl); const parts = cacheControl.split(/,\s*?\b/); for (let i5 = 0; i5 < parts.length; i5++) { const part = parts[i5]; @@ -53924,24 +51379,24 @@ function isFresh(cache5) { expires = (cache5.date || 0) + parseInt(subparts[1], 10) * 1e3; fresh = Date.now() < expires; if (fresh) { - debug10('cache is "fresh" due to previous %o Cache-Control param', part); + debug9('cache is "fresh" due to previous %o Cache-Control param', part); } return fresh; case "must-revalidate": break; case "no-cache": case "no-store": - debug10('cache is "stale" due to explicit %o Cache-Control param', name); + debug9('cache is "stale" due to explicit %o Cache-Control param', name); return false; default: break; } } } else if (expires) { - debug10("Expires: %o", expires); + debug9("Expires: %o", expires); fresh = Date.now() < expires; if (fresh) { - debug10('cache is "fresh" due to previous Expires response header'); + debug9('cache is "fresh" due to previous Expires response header'); } return fresh; } @@ -53963,7 +51418,7 @@ function getCache(url, cache5) { } return null; } -var import_http2, import_https3, import_events2, import_debug8, debug10, http3; +var import_http2, import_https3, import_events2, import_debug8, debug9, http4; var init_http = __esm({ "node_modules/get-uri/dist/http.js"() { import_http2 = __toESM(require("http"), 1); @@ -53973,27 +51428,27 @@ var init_http = __esm({ init_http_error(); init_notfound(); init_notmodified(); - debug10 = (0, import_debug8.default)("get-uri:http"); - http3 = async (url, opts = {}) => { - debug10("GET %o", url.href); + debug9 = (0, import_debug8.default)("get-uri:http"); + http4 = async (url, opts = {}) => { + debug9("GET %o", url.href); const cache5 = getCache(url, opts.cache); if (cache5 && isFresh(cache5) && typeof cache5.statusCode === "number") { const type2 = cache5.statusCode / 100 | 0; if (type2 === 3 && cache5.headers.location) { - debug10("cached redirect"); + debug9("cached redirect"); throw new Error("TODO: implement cached redirects!"); } throw new NotModifiedError(); } const maxRedirects = typeof opts.maxRedirects === "number" ? opts.maxRedirects : 5; - debug10("allowing %o max redirects", maxRedirects); + debug9("allowing %o max redirects", maxRedirects); let mod; if (opts.http) { mod = opts.http; - debug10("using secure `https` core module"); + debug9("using secure `https` core module"); } else { mod = import_http2.default; - debug10("using `http` core module"); + debug9("using `http` core module"); } const options = { ...opts }; if (cache5) { @@ -54006,12 +51461,12 @@ var init_http = __esm({ const lastModified = cache5.headers["last-modified"]; if (lastModified) { headers["If-Modified-Since"] = lastModified; - debug10('added "If-Modified-Since" request header: %o', lastModified); + debug9('added "If-Modified-Since" request header: %o', lastModified); } const etag = cache5.headers.etag; if (etag) { headers["If-None-Match"] = etag; - debug10('added "If-None-Match" request header: %o', etag); + debug9('added "If-None-Match" request header: %o', etag); } } const req = mod.get(url, options); @@ -54019,7 +51474,7 @@ var init_http = __esm({ const code = res.statusCode || 0; res.date = Date.now(); res.parsed = url; - debug10("got %o response status code", code); + debug9("got %o response status code", code); const type = code / 100 | 0; const location = res.headers.location; if (type === 3 && location) { @@ -54027,17 +51482,17 @@ var init_http = __esm({ opts.redirects = []; const redirects = opts.redirects; if (redirects.length < maxRedirects) { - debug10('got a "redirect" status code with Location: %o', location); + debug9('got a "redirect" status code with Location: %o', location); res.resume(); redirects.push(res); const newUri = new URL(location, url.href); - debug10("resolved redirect URL: %o", newUri.href); + debug9("resolved redirect URL: %o", newUri.href); const left = maxRedirects - redirects.length; - debug10("%o more redirects allowed after this one", left); + debug9("%o more redirects allowed after this one", left); if (newUri.protocol !== url.protocol) { opts.http = newUri.protocol === "https:" ? import_https3.default : void 0; } - return http3(newUri, opts); + return http4(newUri, opts); } } if (type !== 2) { @@ -54058,13 +51513,13 @@ var init_http = __esm({ }); // node_modules/get-uri/dist/https.js -var import_https4, https2; +var import_https4, https3; var init_https = __esm({ "node_modules/get-uri/dist/https.js"() { import_https4 = __toESM(require("https"), 1); init_http(); - https2 = (url, opts) => { - return http3(url, { ...opts, http: import_https4.default }); + https3 = (url, opts) => { + return http4(url, { ...opts, http: import_https4.default }); }; } }); @@ -54074,7 +51529,7 @@ function isValidProtocol(p2) { return VALID_PROTOCOLS.has(p2); } async function getUri(uri, opts) { - debug11("getUri(%o)", uri); + debug10("getUri(%o)", uri); if (!uri) { throw new TypeError('Must pass in a URI to "getUri()"'); } @@ -54086,7 +51541,7 @@ async function getUri(uri, opts) { const getter = protocols[protocol]; return getter(url, opts); } -var import_debug9, debug11, protocols, VALID_PROTOCOLS; +var import_debug9, debug10, protocols, VALID_PROTOCOLS; var init_dist6 = __esm({ "node_modules/get-uri/dist/index.js"() { import_debug9 = __toESM(require_src(), 1); @@ -54095,13 +51550,13 @@ var init_dist6 = __esm({ init_ftp(); init_http(); init_https(); - debug11 = (0, import_debug9.default)("get-uri"); + debug10 = (0, import_debug9.default)("get-uri"); protocols = { data: data2, file, ftp, - http: http3, - https: https2 + http: http4, + https: https3 }; VALID_PROTOCOLS = new Set(Object.keys(protocols)); } @@ -55073,7 +52528,7 @@ var require_keyword = __commonJS({ }); // node_modules/esutils/lib/utils.js -var require_utils4 = __commonJS({ +var require_utils3 = __commonJS({ "node_modules/esutils/lib/utils.js"(exports2) { (function() { "use strict"; @@ -56907,7 +54362,7 @@ var require_escodegen = __commonJS({ "use strict"; var Syntax, Precedence, BinaryPrecedence, SourceNode, estraverse, esutils, base, indent, json, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse, sourceMap, sourceCode, preserveBlankLines, FORMAT_MINIFY, FORMAT_DEFAULTS; estraverse = require_estraverse(); - esutils = require_utils4(); + esutils = require_utils3(); Syntax = estraverse.Syntax; function isExpression(node) { return CodeGenerator.Expression.hasOwnProperty(node.type); @@ -63573,45 +61028,45 @@ var require_esprima = __commonJS({ this.errors = []; this.tolerant = false; } - ErrorHandler2.prototype.recordError = function(error2) { - this.errors.push(error2); + ErrorHandler2.prototype.recordError = function(error3) { + this.errors.push(error3); }; - ErrorHandler2.prototype.tolerate = function(error2) { + ErrorHandler2.prototype.tolerate = function(error3) { if (this.tolerant) { - this.recordError(error2); + this.recordError(error3); } else { - throw error2; + throw error3; } }; ErrorHandler2.prototype.constructError = function(msg, column) { - var error2 = new Error(msg); + var error3 = new Error(msg); try { - throw error2; + throw error3; } catch (base) { if (Object.create && Object.defineProperty) { - error2 = Object.create(base); - Object.defineProperty(error2, "column", { value: column }); + error3 = Object.create(base); + Object.defineProperty(error3, "column", { value: column }); } } - return error2; + return error3; }; ErrorHandler2.prototype.createError = function(index, line, col, description) { var msg = "Line " + line + ": " + description; - var error2 = this.constructError(msg, col); - error2.index = index; - error2.lineNumber = line; - error2.description = description; - return error2; + var error3 = this.constructError(msg, col); + error3.index = index; + error3.lineNumber = line; + error3.description = description; + return error3; }; ErrorHandler2.prototype.throwError = function(index, line, col, description) { throw this.createError(index, line, col, description); }; ErrorHandler2.prototype.tolerateError = function(index, line, col, description) { - var error2 = this.createError(index, line, col, description); + var error3 = this.createError(index, line, col, description); if (this.tolerant) { - this.recordError(error2); + this.recordError(error3); } else { - throw error2; + throw error3; } }; return ErrorHandler2; @@ -67390,7 +64845,7 @@ var require_shared = __commonJS({ }); // node_modules/ast-types/def/core.js -var require_core2 = __commonJS({ +var require_core = __commonJS({ "node_modules/ast-types/def/core.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -67525,7 +64980,7 @@ var require_es6 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var core_1 = tslib_1.__importDefault(require_core2()); + var core_1 = tslib_1.__importDefault(require_core()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { @@ -68189,7 +65644,7 @@ var require_es_proposals = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); - var core_1 = tslib_1.__importDefault(require_core2()); + var core_1 = tslib_1.__importDefault(require_core()); function default_1(fork) { fork.use(core_1.default); var types3 = fork.use(types_1.default); @@ -68228,7 +65683,7 @@ var require_main = __commonJS({ exports2.visit = exports2.use = exports2.Type = exports2.someField = exports2.PathVisitor = exports2.Path = exports2.NodePath = exports2.namedTypes = exports2.getSupertypeNames = exports2.getFieldValue = exports2.getFieldNames = exports2.getBuilderName = exports2.finalize = exports2.eachField = exports2.defineMethod = exports2.builtInTypes = exports2.builders = exports2.astNodesAreEquivalent = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var fork_1 = tslib_1.__importDefault(require_fork()); - var core_1 = tslib_1.__importDefault(require_core2()); + var core_1 = tslib_1.__importDefault(require_core()); var es6_1 = tslib_1.__importDefault(require_es6()); var es7_1 = tslib_1.__importDefault(require_es7()); var es2020_1 = tslib_1.__importDefault(require_es2020()); @@ -68735,7 +66190,7 @@ var require_netmask4 = __commonJS({ if (typeof maskStr === "string" && maskStr.indexOf(".") > -1) { try { this.maskLong = ip2long(maskStr); - } catch (error2) { + } catch (error3) { throw new Error("Invalid mask: " + maskStr); } this.bitmask = NaN; @@ -68756,7 +66211,7 @@ var require_netmask4 = __commonJS({ } try { this.netLong = (ip2long(net11) & this.maskLong) >>> 0; - } catch (error2) { + } catch (error3) { throw new Error("Invalid net address: " + net11); } if (!(this.bitmask <= 32)) { @@ -68933,7 +66388,7 @@ var require_netmask6 = __commonJS({ } try { this.netBigint = ip6bigint(net11) & this.maskBigint; - } catch (error2) { + } catch (error3) { throw new Error("Invalid IPv6 net address: " + net11); } this.size = Number(1n << BigInt(128 - this.bitmask)); @@ -68985,8 +66440,14 @@ var require_netmask = __commonJS({ "node_modules/netmask/dist/netmask.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Netmask = void 0; + exports2.long2ip = exports2.ip2long = exports2.Netmask = void 0; var netmask4_1 = require_netmask4(); + Object.defineProperty(exports2, "ip2long", { enumerable: true, get: function() { + return netmask4_1.ip2long; + } }); + Object.defineProperty(exports2, "long2ip", { enumerable: true, get: function() { + return netmask4_1.long2ip; + } }); var netmask6_1 = require_netmask6(); var Netmask2 = class _Netmask { constructor(net11, mask) { @@ -69007,6 +66468,13 @@ var require_netmask = __commonJS({ this.first = this._impl.first; this.last = this._impl.last; this.broadcast = this._impl.broadcast; + if (this._impl instanceof netmask4_1.Netmask4Impl) { + this.maskLong = this._impl.maskLong; + this.netLong = this._impl.netLong; + } else { + this.maskLong = 0; + this.netLong = 0; + } } contains(ip2) { if (typeof ip2 === "string") { @@ -69113,13 +66581,13 @@ function normalizeFamily(family) { } return family ? family.toLowerCase() : "ipv4"; } -var import_os, ip; +var import_os3, ip; var init_ip = __esm({ "node_modules/pac-resolver/dist/ip.js"() { - import_os = __toESM(require("os"), 1); + import_os3 = __toESM(require("os"), 1); ip = { address() { - const interfaces = import_os.default.networkInterfaces(); + const interfaces = import_os3.default.networkInterfaces(); const family = normalizeFamily(); const all = Object.values(interfaces).map((addrs = []) => { const addresses = addrs.filter((details) => { @@ -69485,7 +66953,7 @@ function parseDylink(module2) { return null; const bytes = new Uint8Array(sections[0]); const offset = { value: 0 }; - const info5 = { + const info2 = { memorySize: 0, memoryAlignment: 0, tableSize: 0, @@ -69497,22 +66965,22 @@ function parseDylink(module2) { const subsectionSize = readULEB128(bytes, offset); const subsectionEnd = offset.value + subsectionSize; if (subsectionType === 1) { - info5.memorySize = readULEB128(bytes, offset); - info5.memoryAlignment = readULEB128(bytes, offset); - info5.tableSize = readULEB128(bytes, offset); - info5.tableAlignment = readULEB128(bytes, offset); + info2.memorySize = readULEB128(bytes, offset); + info2.memoryAlignment = readULEB128(bytes, offset); + info2.tableSize = readULEB128(bytes, offset); + info2.tableAlignment = readULEB128(bytes, offset); } else if (subsectionType === 2) { const count = readULEB128(bytes, offset); for (let i5 = 0; i5 < count; i5++) { const len = readULEB128(bytes, offset); const name = new TextDecoder().decode(bytes.slice(offset.value, offset.value + len)); offset.value += len; - info5.needed.push(name); + info2.needed.push(name); } } offset.value = subsectionEnd; } - return info5; + return info2; } async function loadExtension(descriptor, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy, allocBase) { let module2; @@ -69770,9 +67238,9 @@ var init_dist9 = __esm({ } return next(); }; - })(typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + })(typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) { var e5 = new Error(message); - return e5.name = "SuppressedError", e5.error = error2, e5.suppressed = suppressed, e5; + return e5.name = "SuppressedError", e5.error = error3, e5.suppressed = suppressed, e5; }); EvalFlags = { /** Global script mode (default). */ @@ -71588,7 +69056,7 @@ function omit4(obj, ...keys) { } return ret; } -var import_socks2, import_debug10, dns2, net7, tls4, import_url5, debug12, setServernameFromNonIpHost3, SocksProxyAgent2; +var import_socks2, import_debug10, dns2, net7, tls4, import_url5, debug11, setServernameFromNonIpHost3, SocksProxyAgent2; var init_dist10 = __esm({ "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent/dist/index.js"() { import_socks2 = __toESM(require_build(), 1); @@ -71598,7 +69066,7 @@ var init_dist10 = __esm({ net7 = __toESM(require("net"), 1); tls4 = __toESM(require("tls"), 1); import_url5 = require("url"); - debug12 = (0, import_debug10.default)("socks-proxy-agent"); + debug11 = (0, import_debug10.default)("socks-proxy-agent"); setServernameFromNonIpHost3 = (options) => { if (options.servername === void 0 && options.host && !net7.isIP(options.host)) { return { @@ -71608,7 +69076,7 @@ var init_dist10 = __esm({ } return options; }; - SocksProxyAgent2 = class extends Agent4 { + SocksProxyAgent2 = class extends Agent6 { constructor(uri, opts) { super(opts); const url = typeof uri === "string" ? new import_url5.URL(uri) : uri; @@ -71658,21 +69126,21 @@ var init_dist10 = __esm({ if (tlsSocket) tlsSocket.destroy(); }; - debug12("Creating socks proxy connection: %o", socksOpts); + debug11("Creating socks proxy connection: %o", socksOpts); const { socket } = await import_socks2.SocksClient.createConnection(socksOpts); - debug12("Successfully created socks proxy connection"); + debug11("Successfully created socks proxy connection"); if (timeout !== null) { socket.setTimeout(timeout); socket.on("timeout", () => cleanup()); } if (opts.secureEndpoint) { - debug12("Upgrading socket connection to TLS"); + debug11("Upgrading socket connection to TLS"); const tlsSocket = tls4.connect({ ...omit4(setServernameFromNonIpHost3(opts), "host", "path", "port"), socket }); - tlsSocket.once("error", (error2) => { - debug12("Socket TLS error", error2.message); + tlsSocket.once("error", (error3) => { + debug11("Socket TLS error", error3.message); cleanup(tlsSocket); }); return tlsSocket; @@ -71709,12 +69177,12 @@ function parseProxyResponse2(socket) { } function onend() { cleanup(); - debug13("onend"); + debug12("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } function onerror(err) { cleanup(); - debug13("onerror %o", err); + debug12("onerror %o", err); reject(err); } function ondata(b6) { @@ -71723,7 +69191,7 @@ function parseProxyResponse2(socket) { const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf("\r\n\r\n"); if (endOfHeaders === -1) { - debug13("have not received end of HTTP headers yet..."); + debug12("have not received end of HTTP headers yet..."); read(); return; } @@ -71756,7 +69224,7 @@ function parseProxyResponse2(socket) { headers[key] = value; } } - debug13("got proxy server response: %o %o", firstLine, headers); + debug12("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { @@ -71772,11 +69240,11 @@ function parseProxyResponse2(socket) { read(); }); } -var import_debug11, debug13; +var import_debug11, debug12; var init_parse_proxy_response2 = __esm({ "node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js"() { import_debug11 = __toESM(require_src(), 1); - debug13 = (0, import_debug11.default)("https-proxy-agent:parse-proxy-response"); + debug12 = (0, import_debug11.default)("https-proxy-agent:parse-proxy-response"); } }); @@ -71798,7 +69266,7 @@ function omit5(obj, ...keys) { } return ret; } -var net8, tls5, import_assert2, import_debug12, import_url6, debug14, setServernameFromNonIpHost4, HttpsProxyAgent2; +var net8, tls5, import_assert2, import_debug12, import_url6, debug13, setServernameFromNonIpHost4, HttpsProxyAgent2; var init_dist11 = __esm({ "node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/index.js"() { net8 = __toESM(require("net"), 1); @@ -71808,7 +69276,7 @@ var init_dist11 = __esm({ init_dist5(); import_url6 = require("url"); init_parse_proxy_response2(); - debug14 = (0, import_debug12.default)("https-proxy-agent"); + debug13 = (0, import_debug12.default)("https-proxy-agent"); setServernameFromNonIpHost4 = (options) => { if (options.servername === void 0 && options.host && !net8.isIP(options.host)) { return { @@ -71818,13 +69286,13 @@ var init_dist11 = __esm({ } return options; }; - HttpsProxyAgent2 = class extends Agent4 { + HttpsProxyAgent2 = class extends Agent6 { constructor(proxy, opts) { super(opts); this.options = { path: void 0 }; this.proxy = typeof proxy === "string" ? new import_url6.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; - debug14("Creating new HttpsProxyAgent instance: %o", this.proxy.href); + debug13("Creating new HttpsProxyAgent instance: %o", this.proxy.href); const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { @@ -71846,10 +69314,10 @@ var init_dist11 = __esm({ } let socket; if (proxy.protocol === "https:") { - debug14("Creating `tls.Socket`: %o", this.connectOpts); + debug13("Creating `tls.Socket`: %o", this.connectOpts); socket = tls5.connect(setServernameFromNonIpHost4(this.connectOpts)); } else { - debug14("Creating `net.Socket`: %o", this.connectOpts); + debug13("Creating `net.Socket`: %o", this.connectOpts); socket = net8.connect(this.connectOpts); } const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; @@ -71877,7 +69345,7 @@ var init_dist11 = __esm({ if (connect13.statusCode === 200) { req.once("socket", resume2); if (opts.secureEndpoint) { - debug14("Upgrading socket connection to TLS"); + debug13("Upgrading socket connection to TLS"); return tls5.connect({ ...omit5(setServernameFromNonIpHost4(opts), "host", "path", "port"), socket @@ -71889,7 +69357,7 @@ var init_dist11 = __esm({ const fakeSocket = new net8.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s) => { - debug14("Replaying proxy buffer for failed request"); + debug13("Replaying proxy buffer for failed request"); (0, import_assert2.default)(s.listenerCount("data") > 0); s.push(buffered); s.push(null); @@ -71916,7 +69384,7 @@ function omit6(obj, ...keys) { } return ret; } -var net9, tls6, import_debug13, import_events3, import_url7, debug15, HttpProxyAgent2; +var net9, tls6, import_debug13, import_events3, import_url7, debug14, HttpProxyAgent2; var init_dist12 = __esm({ "node_modules/pac-proxy-agent/node_modules/http-proxy-agent/dist/index.js"() { net9 = __toESM(require("net"), 1); @@ -71925,13 +69393,13 @@ var init_dist12 = __esm({ import_events3 = require("events"); init_dist5(); import_url7 = require("url"); - debug15 = (0, import_debug13.default)("http-proxy-agent"); - HttpProxyAgent2 = class extends Agent4 { + debug14 = (0, import_debug13.default)("http-proxy-agent"); + HttpProxyAgent2 = class extends Agent6 { constructor(proxy, opts) { super(opts); this.proxy = typeof proxy === "string" ? new import_url7.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; - debug15("Creating new HttpProxyAgent instance: %o", this.proxy.href); + debug14("Creating new HttpProxyAgent instance: %o", this.proxy.href); const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { @@ -71977,21 +69445,21 @@ var init_dist12 = __esm({ } let first; let endOfHeaders; - debug15("Regenerating stored HTTP header string for request"); + debug14("Regenerating stored HTTP header string for request"); req._implicitHeader(); if (req.outputData && req.outputData.length > 0) { - debug15("Patching connection write() output buffer with updated header"); + debug14("Patching connection write() output buffer with updated header"); first = req.outputData[0].data; endOfHeaders = first.indexOf("\r\n\r\n") + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); - debug15("Output buffer: %o", req.outputData[0].data); + debug14("Output buffer: %o", req.outputData[0].data); } let socket; if (this.proxy.protocol === "https:") { - debug15("Creating `tls.Socket`: %o", this.connectOpts); + debug14("Creating `tls.Socket`: %o", this.connectOpts); socket = tls6.connect(this.connectOpts); } else { - debug15("Creating `net.Socket`: %o", this.connectOpts); + debug14("Creating `net.Socket`: %o", this.connectOpts); socket = net9.connect(this.connectOpts); } await (0, import_events3.once)(socket, "connect"); @@ -72007,12 +69475,12 @@ var dist_exports7 = {}; __export(dist_exports7, { PacProxyAgent: () => PacProxyAgent }); -var net10, tls7, crypto2, import_events4, import_debug14, import_url8, debug16, setServernameFromNonIpHost5, PacProxyAgent; +var net10, tls7, crypto3, import_events4, import_debug14, import_url8, debug15, setServernameFromNonIpHost5, PacProxyAgent; var init_dist13 = __esm({ "node_modules/pac-proxy-agent/dist/index.js"() { net10 = __toESM(require("net"), 1); tls7 = __toESM(require("tls"), 1); - crypto2 = __toESM(require("crypto"), 1); + crypto3 = __toESM(require("crypto"), 1); import_events4 = require("events"); import_debug14 = __toESM(require_src(), 1); import_url8 = require("url"); @@ -72020,7 +69488,7 @@ var init_dist13 = __esm({ init_dist6(); init_dist8(); init_dist9(); - debug16 = (0, import_debug14.default)("pac-proxy-agent"); + debug15 = (0, import_debug14.default)("pac-proxy-agent"); setServernameFromNonIpHost5 = (options) => { if (options.servername === void 0 && options.host && !net10.isIP(options.host)) { return { @@ -72030,7 +69498,7 @@ var init_dist13 = __esm({ } return options; }; - PacProxyAgent = class extends Agent4 { + PacProxyAgent = class extends Agent6 { constructor(uri, opts) { super(opts); this.clearResolverPromise = () => { @@ -72038,7 +69506,7 @@ var init_dist13 = __esm({ }; const uriStr = typeof uri === "string" ? uri : uri.href; this.uri = new import_url8.URL(uriStr.replace(/^pac\+/i, "")); - debug16("Creating PacProxyAgent with URI %o", this.uri.href); + debug15("Creating PacProxyAgent with URI %o", this.uri.href); this.opts = { ...opts }; this.cache = void 0; this.resolver = void 0; @@ -72065,9 +69533,9 @@ var init_dist13 = __esm({ QuickJS.create(), this.loadPacFile() ]); - const hash = crypto2.createHash("sha1").update(code).digest("hex"); + const hash = crypto3.createHash("sha1").update(code).digest("hex"); if (this.resolver && this.resolverHash === hash) { - debug16("Same sha1 hash for code - contents have not changed, reusing previous proxy resolver"); + debug15("Same sha1 hash for code - contents have not changed, reusing previous proxy resolver"); qjs.dispose(); return this.resolver; } @@ -72075,13 +69543,13 @@ var init_dist13 = __esm({ this.qjs.dispose(); } this.qjs = qjs; - debug16("Creating new proxy resolver instance"); + debug15("Creating new proxy resolver instance"); this.resolver = createPacResolver(qjs, code, this.opts); this.resolverHash = hash; return this.resolver; } catch (err) { if (this.resolver && err.code === "ENOTMODIFIED") { - debug16("Got ENOTMODIFIED response, reusing previous proxy resolver"); + debug15("Got ENOTMODIFIED response, reusing previous proxy resolver"); return this.resolver; } throw err; @@ -72093,12 +69561,12 @@ var init_dist13 = __esm({ * @api private */ async loadPacFile() { - debug16("Loading PAC file: %o", this.uri); + debug15("Loading PAC file: %o", this.uri); const rs = await getUri(this.uri, { ...this.opts, cache: this.cache }); - debug16("Got `Readable` instance for URI"); + debug15("Got `Readable` instance for URI"); this.cache = rs; const buf = await toBuffer(rs); - debug16("Read %o byte PAC file from URI", buf.length); + debug15("Read %o byte PAC file from URI", buf.length); return buf.toString("utf8"); } /** @@ -72112,7 +69580,7 @@ var init_dist13 = __esm({ const host = opts.host && net10.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; const defaultPort = secureEndpoint ? 443 : 80; const url = Object.assign(new import_url8.URL(req.path, `${protocol}//${host}`), defaultPort ? void 0 : { port: opts.port }); - debug16("url: %s", url); + debug15("url: %s", url); let result = await resolver(url); if (!result) { result = "DIRECT"; @@ -72125,7 +69593,7 @@ var init_dist13 = __esm({ let agent = null; let socket = null; const [type, target] = proxy.split(/\s+/); - debug16("Attempting to use proxy: %o", proxy); + debug15("Attempting to use proxy: %o", proxy); if (type === "DIRECT") { if (secureEndpoint) { socket = tls7.connect(setServernameFromNonIpHost5(opts)); @@ -72164,7 +69632,7 @@ var init_dist13 = __esm({ } throw new Error(`Could not determine proxy type for: ${proxy}`); } catch (err) { - debug16("Got error for proxy %o: %o", proxy, err); + debug15("Got error for proxy %o: %o", proxy, err); req.emit("proxy", { proxy, error: err }); } } @@ -72187,17 +69655,1357 @@ __export(index_exports, { run: () => run }); module.exports = __toCommonJS(index_exports); -var core4 = __toESM(require_core()); + +// 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 crypto2 = __toESM(require("crypto"), 1); +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" + }); +} +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = toCommandValue(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; +} + +// node_modules/@actions/core/lib/core.js +var os4 = __toESM(require("os"), 1); + +// node_modules/@actions/http-client/lib/index.js +var http = __toESM(require("http"), 1); +var https = __toESM(require("https"), 1); + +// node_modules/@actions/http-client/lib/proxy.js +function getProxyUrl(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 DecodedURL(proxyVar); + } catch (_a2) { + 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; + } + } + 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/http-client/lib/index.js +var tunnel = __toESM(require_tunnel2(), 1); +var import_undici = __toESM(require_undici(), 1); +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 (e5) { + reject(e5); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e5) { + reject(e5); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +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 Headers2; +(function(Headers3) { + Headers3["Accept"] = "accept"; + Headers3["ContentType"] = "content-type"; +})(Headers2 || (Headers2 = {})); +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 +]; +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); + } +}; +var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(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 __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(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 HttpClient = class { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data3, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data3, additionalHeaders || {}); + }); + } + patch(requestUrl, data3, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data3, additionalHeaders || {}); + }); + } + put(requestUrl, data3, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data3, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(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_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data3 = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data3, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data3 = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data3, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl_1, obj_1) { + return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + const data3 = JSON.stringify(obj, null, 2); + additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data3, 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, data3, headers) { + return __awaiter(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, data3); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info2, data3); + } else { + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && HttpRedirectCodes.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, data3); + redirectsRemaining--; + } + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info2, data3) { + return __awaiter(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, data3, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info2, data3, onResult) { + if (typeof data3 === "string") { + if (!info2.options.headers) { + info2.options.headers = {}; + } + info2.options.headers["Content-Length"] = Buffer.byteLength(data3, "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 (data3 && typeof data3 === "string") { + req.write(data3, "utf8"); + } + if (data3 && typeof data3 !== "string") { + data3.on("close", function() { + req.end(); + }); + data3.pipe(req); + } else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = getProxyUrl(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 handler of this.handlers) { + handler.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 || {}); + } + /** + * 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. + */ + _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; + } + /** + * 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]). + */ + _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 = getProxyUrl(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 ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.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_undici.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(userAgent) { + const baseUserAgent = userAgent || "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 __awaiter(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 __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a5 = new Date(value); + if (!isNaN(a5.valueOf())) { + return a5; + } + } + 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 lowercaseKeys = (obj) => Object.keys(obj).reduce((c5, k5) => (c5[k5.toLowerCase()] = obj[k5], c5), {}); + +// node_modules/@actions/http-client/lib/auth.js +var __awaiter2 = 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 (e5) { + reject(e5); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e5) { + reject(e5); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var BearerCredentialHandler = class { + constructor(token) { + this.token = token; + } + // 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"] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } +}; + +// node_modules/@actions/core/lib/oidc-utils.js +var __awaiter3 = 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 (e5) { + reject(e5); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e5) { + reject(e5); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new HttpClient("actions/oidc-client", [new 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) { + return __awaiter3(this, void 0, void 0, function* () { + var _a2; + 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 = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter3(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}`; + } + debug(`ID token url is ${id_token_url}`); + const id_token = yield _OidcClient.getCall(id_token_url); + setSecret(id_token); + return id_token; + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); + } + }); + } +}; + +// node_modules/@actions/core/lib/summary.js +var import_os = require("os"); +var import_fs = require("fs"); +var __awaiter4 = 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 (e5) { + reject(e5); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e5) { + reject(e5); + } + } + 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 __awaiter4(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 (_a2) { + 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(tag2, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); + if (!content) { + return `<${tag2}${htmlAttrs}>`; + } + return `<${tag2}${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 __awaiter4(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 __awaiter4(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 tag2 = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag2, 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: data3, colspan, rowspan } = cell; + const tag2 = header ? "th" : "td"; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag2, data3, 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 tag2 = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag2) ? tag2 : "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(); + +// node_modules/@actions/core/lib/platform.js +var import_os2 = __toESM(require("os"), 1); + +// 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/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 __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 (e5) { + reject(e5); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e5) { + reject(e5); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var ExitCode; +(function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; +})(ExitCode || (ExitCode = {})); +function exportVariable(name, val) { + const convertedVal = toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return issueFileCommand("ENV", prepareKeyValueMessage(name, val)); + } + issueCommand("set-env", { name }, convertedVal); +} +function setSecret(secret) { + issueCommand("add-mask", {}, secret); +} +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}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); +} +function getMultilineInput(name, options) { + const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); +} +function setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return issueFileCommand("OUTPUT", prepareKeyValueMessage(name, value)); + } + process.stdout.write(os4.EOL); + issueCommand("set-output", { name }, toCommandValue(value)); +} +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +function debug(message) { + issueCommand("debug", {}, 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 notice(message, properties = {}) { + issueCommand("notice", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +function info(message) { + process.stdout.write(message + os4.EOL); +} +function getIDToken(aud) { + return __awaiter5(this, void 0, void 0, function* () { + return yield OidcClient.getIDToken(aud); + }); +} // src/assumeRole.ts var import_node_assert = __toESM(require("node:assert")); var import_node_fs = __toESM(require("node:fs")); var import_node_path = __toESM(require("node:path")); -var core2 = __toESM(require_core()); var import_client_sts2 = __toESM(require_dist_cjs56()); // src/helpers.ts -var core = __toESM(require_core()); var import_client_sts = __toESM(require_dist_cjs56()); var MAX_TAG_VALUE_LENGTH = 256; var SANITIZATION_CHARACTER = "_"; @@ -72237,55 +71045,55 @@ function translateEnvVariables() { } function exportCredentials(creds, outputCredentials, outputEnvCredentials) { if (creds?.AccessKeyId) { - core.setSecret(creds.AccessKeyId); + setSecret(creds.AccessKeyId); } if (creds?.SecretAccessKey) { - core.setSecret(creds.SecretAccessKey); + setSecret(creds.SecretAccessKey); } if (creds?.SessionToken) { - core.setSecret(creds.SessionToken); + setSecret(creds.SessionToken); } if (outputEnvCredentials) { if (creds?.AccessKeyId) { - core.exportVariable("AWS_ACCESS_KEY_ID", creds.AccessKeyId); + exportVariable("AWS_ACCESS_KEY_ID", creds.AccessKeyId); } if (creds?.SecretAccessKey) { - core.exportVariable("AWS_SECRET_ACCESS_KEY", creds.SecretAccessKey); + exportVariable("AWS_SECRET_ACCESS_KEY", creds.SecretAccessKey); } if (creds?.SessionToken) { - core.exportVariable("AWS_SESSION_TOKEN", creds.SessionToken); + exportVariable("AWS_SESSION_TOKEN", creds.SessionToken); } else if (process.env.AWS_SESSION_TOKEN) { - core.exportVariable("AWS_SESSION_TOKEN", ""); + exportVariable("AWS_SESSION_TOKEN", ""); } } if (outputCredentials) { if (creds?.AccessKeyId) { - core.setOutput("aws-access-key-id", creds.AccessKeyId); + setOutput("aws-access-key-id", creds.AccessKeyId); } if (creds?.SecretAccessKey) { - core.setOutput("aws-secret-access-key", creds.SecretAccessKey); + setOutput("aws-secret-access-key", creds.SecretAccessKey); } if (creds?.SessionToken) { - core.setOutput("aws-session-token", creds.SessionToken); + setOutput("aws-session-token", creds.SessionToken); } if (creds?.Expiration) { - core.setOutput("aws-expiration", creds.Expiration); + setOutput("aws-expiration", creds.Expiration); } } } function unsetCredentials(outputEnvCredentials) { if (outputEnvCredentials) { - core.exportVariable("AWS_ACCESS_KEY_ID", ""); - core.exportVariable("AWS_SECRET_ACCESS_KEY", ""); - core.exportVariable("AWS_SESSION_TOKEN", ""); - core.exportVariable("AWS_REGION", ""); - core.exportVariable("AWS_DEFAULT_REGION", ""); + exportVariable("AWS_ACCESS_KEY_ID", ""); + exportVariable("AWS_SECRET_ACCESS_KEY", ""); + exportVariable("AWS_SESSION_TOKEN", ""); + exportVariable("AWS_REGION", ""); + exportVariable("AWS_DEFAULT_REGION", ""); } } function exportRegion(region, outputEnvCredentials) { if (outputEnvCredentials) { - core.exportVariable("AWS_DEFAULT_REGION", region); - core.exportVariable("AWS_REGION", region); + exportVariable("AWS_DEFAULT_REGION", region); + exportVariable("AWS_REGION", region); } } async function getCallerIdentity(client) { @@ -72307,11 +71115,11 @@ async function exportAccountId(credentialsClient, maskAccountId) { const accountId = identity.Account; const arn = identity.Arn; if (maskAccountId) { - core.setSecret(accountId); - core.setSecret(arn); + setSecret(accountId); + setSecret(arn); } - core.setOutput("aws-account-id", accountId); - core.setOutput("authenticated-arn", arn); + setOutput("aws-account-id", accountId); + setOutput("authenticated-arn", arn); return accountId; } function sanitizeGitHubVariables(name) { @@ -72329,13 +71137,13 @@ function verifyKeys(creds) { } if (creds.AccessKeyId) { if (SPECIAL_CHARS_REGEX.test(creds.AccessKeyId)) { - core.debug("AccessKeyId contains special characters."); + debug("AccessKeyId contains special characters."); return false; } } if (creds.SecretAccessKey) { if (SPECIAL_CHARS_REGEX.test(creds.SecretAccessKey)) { - core.debug("SecretAccessKey contains special characters."); + debug("SecretAccessKey contains special characters."); return false; } } @@ -72346,24 +71154,24 @@ async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, ba return await fn(); } catch (err) { if (!isRetryable) { - core.debug(`retryAndBackoff: error is not retryable: ${errorMessage(err)}`); + debug(`retryAndBackoff: error is not retryable: ${errorMessage(err)}`); throw err; } const delay = Math.random() * (2 ** retries * base); const nextRetry = retries + 1; - core.debug( + debug( `retryAndBackoff: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. Retrying after ${Math.floor(delay)}ms.` ); await sleep(delay); if (nextRetry >= maxRetries) { - core.debug("retryAndBackoff: reached max retries; giving up."); + debug("retryAndBackoff: reached max retries; giving up."); throw err; } return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base); } } -function errorMessage(error2) { - return error2 instanceof Error ? error2.message : String(error2); +function errorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } function isDefined(i5) { return i5 !== void 0 && i5 !== null; @@ -72385,7 +71193,7 @@ function getBooleanInput(name, options) { const falseValue = ["false", "False", "FALSE"]; const optionsWithoutDefault = { ...options }; delete optionsWithoutDefault.default; - const val = core.getInput(name, optionsWithoutDefault); + const val = getInput(name, optionsWithoutDefault); if (trueValue.includes(val)) return true; if (falseValue.includes(val)) return false; if (val === "") return options?.default ?? false; @@ -72399,7 +71207,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` async function assumeRoleWithOIDC(params, client, webIdentityToken) { delete params.Tags; delete params.TransitiveTagKeys; - core2.info("Assuming role with OIDC"); + info("Assuming role with OIDC"); try { const creds = await client.send( new import_client_sts2.AssumeRoleWithWebIdentityCommand({ @@ -72408,19 +71216,19 @@ async function assumeRoleWithOIDC(params, client, webIdentityToken) { }) ); return creds; - } catch (error2) { - throw new Error(`Could not assume role with OIDC: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`Could not assume role with OIDC: ${errorMessage(error3)}`); } } async function assumeRoleWithWebIdentityTokenFile(params, client, webIdentityTokenFile, workspace) { - core2.debug( + debug( "webIdentityTokenFile provided. Will call sts:AssumeRoleWithWebIdentity and take session tags from token contents." ); const webIdentityTokenFilePath = import_node_path.default.isAbsolute(webIdentityTokenFile) ? webIdentityTokenFile : import_node_path.default.join(workspace, webIdentityTokenFile); if (!import_node_fs.default.existsSync(webIdentityTokenFilePath)) { throw new Error(`Web identity token file does not exist: ${webIdentityTokenFilePath}`); } - core2.info("Assuming role with web identity token file"); + info("Assuming role with web identity token file"); try { const webIdentityToken = import_node_fs.default.readFileSync(webIdentityTokenFilePath, "utf8"); delete params.Tags; @@ -72431,19 +71239,75 @@ async function assumeRoleWithWebIdentityTokenFile(params, client, webIdentityTok }) ); return creds; - } catch (error2) { - throw new Error(`Could not assume role with web identity token file: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`Could not assume role with web identity token file: ${errorMessage(error3)}`); } } async function assumeRoleWithCredentials(params, client) { - core2.info("Assuming role with user credentials"); + info("Assuming role with user credentials"); try { const creds = await client.send(new import_client_sts2.AssumeRoleCommand({ ...params })); return creds; - } catch (error2) { - throw new Error(`Could not assume role with user credentials: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`Could not assume role with user credentials: ${errorMessage(error3)}`); } } +var TAG_KEY_REGEX = /^[\p{L}\p{Z}\p{N}_.:/=+\-@]+$/u; +var TAG_VALUE_REGEX = /^[\p{L}\p{Z}\p{N}_.:/=+\-@]*$/u; +var MAX_TAG_KEY_LENGTH = 128; +var MAX_TAG_VALUE_LENGTH2 = 256; +var MAX_SESSION_TAGS = 50; +function parseAndValidateCustomTags(customTags, existingTags) { + let parsed; + try { + parsed = JSON.parse(customTags); + } catch { + throw new Error("custom-tags: input is not valid JSON"); + } + if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { + throw new Error("custom-tags: input must be a JSON object (not an array or primitive)"); + } + const reservedKeys = new Set(existingTags.map((tag2) => tag2.Key)); + const newTags = []; + for (const [key, value] of Object.entries(parsed)) { + if (typeof value === "object") { + throw new Error( + `custom-tags: value for key '${key}' must be a string, number, or boolean (not an object or array)` + ); + } + const stringValue = String(value); + if (key.length === 0 || key.length > MAX_TAG_KEY_LENGTH) { + throw new Error(`custom-tags: key '${key}' must be between 1 and ${MAX_TAG_KEY_LENGTH} characters`); + } + if (stringValue.length > MAX_TAG_VALUE_LENGTH2) { + throw new Error( + `custom-tags: value for key '${key}' exceeds maximum length of ${MAX_TAG_VALUE_LENGTH2} characters` + ); + } + if (!TAG_KEY_REGEX.test(key)) { + throw new Error( + `custom-tags: key '${key}' contains invalid characters. Allowed: unicode letters, digits, spaces, and _.:/=+-@` + ); + } + if (stringValue.length > 0 && !TAG_VALUE_REGEX.test(stringValue)) { + throw new Error( + `custom-tags: value for key '${key}' contains invalid characters. Allowed: unicode letters, digits, spaces, and _.:/=+-@` + ); + } + if (reservedKeys.has(key)) { + throw new Error( + `custom-tags: key '${key}' conflicts with a default session tag set by this action and cannot be overridden` + ); + } + newTags.push({ Key: key, Value: stringValue }); + } + if (existingTags.length + newTags.length > MAX_SESSION_TAGS) { + throw new Error( + `custom-tags: total session tags (${existingTags.length + newTags.length}) would exceed the AWS limit of ${MAX_SESSION_TAGS}` + ); + } + return newTags; +} async function assumeRole(params) { const { credentialsClient, @@ -72457,7 +71321,8 @@ async function assumeRole(params) { webIdentityTokenFile, webIdentityToken, inlineSessionPolicy, - managedSessionPolicies + managedSessionPolicies, + customTags } = { ...params }; const { GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_SHA, GITHUB_WORKSPACE } = process.env; if (!GITHUB_REPOSITORY || !GITHUB_WORKFLOW || !GITHUB_ACTION || !GITHUB_ACTOR || !GITHUB_SHA || !GITHUB_WORKSPACE) { @@ -72477,11 +71342,15 @@ async function assumeRole(params) { Value: sanitizeGitHubVariables(process.env.GITHUB_REF) }); } + if (customTags) { + const parsed = parseAndValidateCustomTags(customTags, tagArray); + tagArray.push(...parsed); + } const tags = roleSkipSessionTagging ? void 0 : tagArray; if (!tags) { - core2.debug("Role session tagging has been skipped."); + debug("Role session tagging has been skipped."); } else { - core2.debug(`${tags.length} role session tags are being used.`); + debug(`${tags.length} role session tags are being used:`); } const transitiveTagKeysArray = roleSkipSessionTagging ? void 0 : transitiveTagKeys?.filter((key) => tags?.some((tag2) => tag2.Key === key)); let roleArn = roleToAssume; @@ -72524,13 +71393,12 @@ async function assumeRole(params) { } // src/CredentialsClient.ts -var import_core12 = __toESM(require_core()); var import_client_sts3 = __toESM(require_dist_cjs56()); var import_node_http_handler5 = __toESM(require_dist_cjs13()); // node_modules/proxy-agent/dist/index.js -var http4 = __toESM(require("http"), 1); -var https3 = __toESM(require("https"), 1); +var http5 = __toESM(require("http"), 1); +var https4 = __toESM(require("https"), 1); var import_url9 = require("url"); // node_modules/proxy-agent/node_modules/lru-cache/index.mjs @@ -73601,7 +72469,7 @@ function getEnv(key) { } // node_modules/proxy-agent/dist/index.js -var debug17 = (0, import_debug15.default)("proxy-agent"); +var debug16 = (0, import_debug15.default)("proxy-agent"); var wellKnownAgents = { http: async () => (await Promise.resolve().then(() => (init_dist2(), dist_exports))).HttpProxyAgent, https: async () => (await Promise.resolve().then(() => (init_dist3(), dist_exports2))).HttpsProxyAgent, @@ -73625,17 +72493,17 @@ var proxies = { function isValidProtocol2(v) { return Object.keys(proxies).includes(v); } -var ProxyAgent = class extends Agent2 { +var ProxyAgent2 = class extends Agent4 { constructor(opts) { super(opts); this.cache = new lru_cache_default({ max: 20, dispose: (agent) => agent.destroy() }); - debug17("Creating new ProxyAgent instance: %o", opts); + debug16("Creating new ProxyAgent instance: %o", opts); this.connectOpts = opts; - this.httpAgent = opts?.httpAgent || new http4.Agent(opts); - this.httpsAgent = opts?.httpsAgent || new https3.Agent(opts); + this.httpAgent = opts?.httpAgent || new http5.Agent(opts); + this.httpsAgent = opts?.httpsAgent || new https4.Agent(opts); this.getProxyForUrl = opts?.getProxyForUrl || getProxyForUrl; } async connect(req, opts) { @@ -73646,11 +72514,11 @@ var ProxyAgent = class extends Agent2 { const url = new import_url9.URL(req.path, `${protocol}//${host}`).href; const proxy = await this.getProxyForUrl(url, req); if (!proxy) { - debug17("Proxy not enabled for URL: %o", url); + debug16("Proxy not enabled for URL: %o", url); return secureEndpoint ? this.httpsAgent : this.httpAgent; } - debug17("Request URL: %o", url); - debug17("Proxy URL: %o", proxy); + debug16("Request URL: %o", url); + debug16("Proxy URL: %o", proxy); const cacheKey = `${protocol}+${proxy}`; let agent = this.cache.get(cacheKey); if (!agent) { @@ -73663,7 +72531,7 @@ var ProxyAgent = class extends Agent2 { agent = new ctor(proxy, this.connectOpts); this.cache.set(cacheKey, agent); } else { - debug17("Cache hit for proxy URL: %o", proxy); + debug16("Cache hit for proxy URL: %o", proxy); } return agent; } @@ -73733,7 +72601,7 @@ var CredentialsClient = class { this.region = props.region; } if (props.proxyServer) { - (0, import_core12.info)("Configuring proxy handler for STS client"); + info("Configuring proxy handler for STS client"); const proxyOptions = { httpProxy: props.proxyServer, httpsProxy: props.proxyServer @@ -73742,7 +72610,7 @@ var CredentialsClient = class { proxyOptions.noProxy = props.noProxy; } const getProxyForUrl2 = new ProxyResolver(proxyOptions).getProxyForUrl; - const handler = new ProxyAgent({ getProxyForUrl: getProxyForUrl2 }); + const handler = new ProxyAgent2({ getProxyForUrl: getProxyForUrl2 }); this.requestHandler = new import_node_http_handler5.NodeHttpHandler({ httpsAgent: handler, httpAgent: handler @@ -73766,15 +72634,15 @@ var CredentialsClient = class { if (!credentials.accessKeyId) { throw new Error("Access key ID empty after loading credentials"); } - } catch (error2) { - throw new Error(`Credentials could not be loaded, please check your action inputs: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`Credentials could not be loaded, please check your action inputs: ${errorMessage(error3)}`); } if (expectedAccountIds && expectedAccountIds.length > 0 && expectedAccountIds[0] !== "") { let callerIdentity; try { callerIdentity = await getCallerIdentity(this.stsClient); - } catch (error2) { - throw new Error(`Could not validate account ID of credentials: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`Could not validate account ID of credentials: ${errorMessage(error3)}`); } if (!callerIdentity.Account || !expectedAccountIds.includes(callerIdentity.Account)) { throw new Error( @@ -73800,10 +72668,9 @@ var CredentialsClient = class { }; // src/profileManager.ts -var fs2 = __toESM(require("node:fs")); -var os2 = __toESM(require("node:os")); +var fs4 = __toESM(require("node:fs")); +var os6 = __toESM(require("node:os")); var path2 = __toESM(require("node:path")); -var core3 = __toESM(require_core()); function parseIni(iniData) { const result = {}; let currentSection; @@ -73851,8 +72718,8 @@ function stringifyIni(data3) { `; } function getProfileFilePaths() { - const credentialsPath = process.env.AWS_SHARED_CREDENTIALS_FILE || path2.join(os2.homedir(), ".aws", "credentials"); - const configPath = process.env.AWS_CONFIG_FILE || path2.join(os2.homedir(), ".aws", "config"); + const credentialsPath = process.env.AWS_SHARED_CREDENTIALS_FILE || path2.join(os6.homedir(), ".aws", "credentials"); + const configPath = process.env.AWS_CONFIG_FILE || path2.join(os6.homedir(), ".aws", "config"); return { credentials: credentialsPath, config: configPath @@ -73860,9 +72727,9 @@ function getProfileFilePaths() { } function ensureAwsDirectoryExists(filePath) { const dir = path2.dirname(filePath); - if (!fs2.existsSync(dir)) { - core3.debug(`Creating directory: ${dir}`); - fs2.mkdirSync(dir, { recursive: true, mode: 448 }); + if (!fs4.existsSync(dir)) { + debug(`Creating directory: ${dir}`); + fs4.mkdirSync(dir, { recursive: true, mode: 448 }); } } function validateProfileName(profileName) { @@ -73881,9 +72748,9 @@ function validateProfileName(profileName) { } function mergeProfileSection(filePath, sectionName, data3, overwriteAwsProfile) { let existingContent = {}; - if (fs2.existsSync(filePath)) { - core3.debug(`Reading existing file: ${filePath}`); - const fileContent = fs2.readFileSync(filePath, "utf-8"); + if (fs4.existsSync(filePath)) { + debug(`Reading existing file: ${filePath}`); + const fileContent = fs4.readFileSync(filePath, "utf-8"); existingContent = parseIni(fileContent); } if (existingContent[sectionName] && !overwriteAwsProfile) { @@ -73893,8 +72760,8 @@ function mergeProfileSection(filePath, sectionName, data3, overwriteAwsProfile) } existingContent[sectionName] = data3; const content = stringifyIni(existingContent); - core3.debug(`Writing profile to ${filePath}`); - fs2.writeFileSync(filePath, content, { mode: 384 }); + debug(`Writing profile to ${filePath}`); + fs4.writeFileSync(filePath, content, { mode: 384 }); } function writeProfileFiles(profileName, credentials, region, overwriteAwsProfile) { try { @@ -73917,14 +72784,14 @@ function writeProfileFiles(profileName, credentials, region, overwriteAwsProfile const configData = { region }; - core3.info(`Writing credentials to profile: ${profileName}`); + info(`Writing credentials to profile: ${profileName}`); mergeProfileSection(paths.credentials, credsSectionName, credentialsData, overwriteAwsProfile); - core3.info(`Writing config to profile: ${profileName}`); + info(`Writing config to profile: ${profileName}`); mergeProfileSection(paths.config, configSectionName, configData, overwriteAwsProfile); - core3.info(`\u2713 Successfully configured AWS profile: ${profileName}`); - } catch (error2) { + info(`\u2713 Successfully configured AWS profile: ${profileName}`); + } catch (error3) { throw new Error( - `Failed to write AWS profile '${profileName}': ${error2 instanceof Error ? error2.message : String(error2)}` + `Failed to write AWS profile '${profileName}': ${error3 instanceof Error ? error3.message : String(error3)}` ); } } @@ -73936,25 +72803,26 @@ var REGION_REGEX = /^[a-z0-9-]+$/g; async function run() { try { translateEnvVariables(); - const AccessKeyId = core4.getInput("aws-access-key-id", { required: false }); - const SecretAccessKey = core4.getInput("aws-secret-access-key", { required: false }); - const sessionTokenInput = core4.getInput("aws-session-token", { required: false }); + const AccessKeyId = getInput("aws-access-key-id", { required: false }); + const SecretAccessKey = getInput("aws-secret-access-key", { required: false }); + const sessionTokenInput = getInput("aws-session-token", { required: false }); const SessionToken = sessionTokenInput === "" ? void 0 : sessionTokenInput; - const region = core4.getInput("aws-region", { required: true }); - const awsProfile = core4.getInput("aws-profile", { required: false }); + const region = getInput("aws-region", { required: true }); + const awsProfile = getInput("aws-profile", { required: false }); const overwriteAwsProfile = getBooleanInput("overwrite-aws-profile", { required: false }); - const roleToAssume = core4.getInput("role-to-assume", { required: false }); - const audience = core4.getInput("audience", { required: false }); + const roleToAssume = getInput("role-to-assume", { required: false }); + const audience = getInput("audience", { required: false }); const maskAccountId = getBooleanInput("mask-aws-account-id", { required: false }); - const roleExternalId = core4.getInput("role-external-id", { required: false }); - const webIdentityTokenFile = core4.getInput("web-identity-token-file", { required: false }); - const roleDuration = Number.parseInt(core4.getInput("role-duration-seconds", { required: false })) || DEFAULT_ROLE_DURATION; - const roleSessionName = core4.getInput("role-session-name", { required: false }) || ROLE_SESSION_NAME; + const roleExternalId = getInput("role-external-id", { required: false }); + const webIdentityTokenFile = getInput("web-identity-token-file", { required: false }); + const roleDuration = Number.parseInt(getInput("role-duration-seconds", { required: false })) || DEFAULT_ROLE_DURATION; + const roleSessionName = getInput("role-session-name", { required: false }) || ROLE_SESSION_NAME; const roleSkipSessionTagging = getBooleanInput("role-skip-session-tagging", { required: false }); - const transitiveTagKeys = core4.getMultilineInput("transitive-tag-keys", { required: false }); - const proxyServer = core4.getInput("http-proxy", { required: false }) || process.env.HTTP_PROXY; - const inlineSessionPolicy = core4.getInput("inline-session-policy", { required: false }); - const managedSessionPolicies = core4.getMultilineInput("managed-session-policies", { required: false }).map((p2) => { + const transitiveTagKeys = getMultilineInput("transitive-tag-keys", { required: false }); + const proxyServer = getInput("http-proxy", { required: false }) || process.env.HTTP_PROXY; + const customTags = getInput("custom-tags", { required: false }); + const inlineSessionPolicy = getInput("inline-session-policy", { required: false }); + const managedSessionPolicies = getMultilineInput("managed-session-policies", { required: false }).map((p2) => { return { arn: p2 }; }); const roleChaining = getBooleanInput("role-chaining", { required: false }); @@ -73963,17 +72831,17 @@ async function run() { const unsetCurrentCredentials = getBooleanInput("unset-current-credentials", { required: false }); let disableRetry = getBooleanInput("disable-retry", { required: false }); const specialCharacterWorkaround = getBooleanInput("special-characters-workaround", { required: false }); - const useExistingCredentials = core4.getInput("use-existing-credentials", { required: false }); - let maxRetries = Number.parseInt(core4.getInput("retry-max-attempts", { required: false })) || 12; - const expectedAccountIds = core4.getInput("allowed-account-ids", { required: false }).split(",").map((s) => s.trim()); + const useExistingCredentials = getInput("use-existing-credentials", { required: false }); + let maxRetries = Number.parseInt(getInput("retry-max-attempts", { required: false })) || 12; + const expectedAccountIds = getInput("allowed-account-ids", { required: false }).split(",").map((s) => s.trim()); const forceSkipOidc = getBooleanInput("force-skip-oidc", { required: false }); - const noProxy = core4.getInput("no-proxy", { required: false }); - const globalTimeout = Number.parseInt(core4.getInput("action-timeout-s", { required: false })) || 0; + const noProxy = getInput("no-proxy", { required: false }); + const globalTimeout = Number.parseInt(getInput("action-timeout-s", { required: false })) || 0; let timeoutId; if (globalTimeout > 0) { - core4.info(`Setting a global timeout of ${globalTimeout} seconds for the action`); + info(`Setting a global timeout of ${globalTimeout} seconds for the action`); timeoutId = setTimeout(() => { - core4.setFailed(`Action timed out after ${globalTimeout} seconds`); + setFailed(`Action timed out after ${globalTimeout} seconds`); process.exit(1); }, globalTimeout * 1e3); } @@ -73991,7 +72859,7 @@ async function run() { const useGitHubOIDCProvider = () => { if (forceSkipOidc) return false; if (!!roleToAssume && !webIdentityTokenFile && !AccessKeyId && !process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN && !roleChaining) { - core4.info( + info( "It looks like you might be trying to authenticate with OIDC. Did you mean to set the `id-token` permission? If you are not trying to authenticate with OIDC and the action is working successfully, you can ignore this message." ); } @@ -74016,23 +72884,23 @@ async function run() { if (useExistingCredentials) { const validCredentials = await areCredentialsValid(credentialsClient); if (validCredentials) { - core4.notice("Pre-existing credentials are valid. No need to generate new ones."); + notice("Pre-existing credentials are valid. No need to generate new ones."); if (timeoutId) clearTimeout(timeoutId); return; } - core4.notice("No valid credentials exist. Running as normal."); + notice("No valid credentials exist. Running as normal."); } if (useGitHubOIDCProvider()) { try { webIdentityToken = await retryAndBackoff( async () => { - return core4.getIDToken(audience); + return getIDToken(audience); }, !disableRetry, maxRetries ); - } catch (error2) { - throw new Error(`getIDToken call failed: ${errorMessage(error2)}`); + } catch (error3) { + throw new Error(`getIDToken call failed: ${errorMessage(error3)}`); } } else if (AccessKeyId) { if (!SecretAccessKey) { @@ -74050,6 +72918,11 @@ async function run() { await credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds); sourceAccountId = await exportAccountId(credentialsClient, maskAccountId); } + if (customTags && (useGitHubOIDCProvider() || webIdentityTokenFile)) { + warning( + "'custom-tags' is set but will be ignored because session tags cannot be applied when using OIDC or web identity token authentication. Tags are controlled by the identity provider token claims in these authentication flows." + ); + } if (roleToAssume) { let roleCredentials; do { @@ -74067,14 +72940,15 @@ async function run() { webIdentityTokenFile, webIdentityToken, inlineSessionPolicy, - managedSessionPolicies + managedSessionPolicies, + customTags }); }, !disableRetry, maxRetries ); } while (specialCharacterWorkaround && !verifyKeys(roleCredentials.Credentials)); - core4.info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`); + info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`); exportCredentials(roleCredentials.Credentials, outputCredentials, outputEnvCredentials); if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile) { await credentialsClient.validateCredentials( @@ -74101,31 +72975,31 @@ async function run() { writeProfileFiles(awsProfile, roleCredentials.Credentials, region, overwriteAwsProfile); } if (outputEnvCredentials) { - core4.exportVariable("AWS_PROFILE", awsProfile); + exportVariable("AWS_PROFILE", awsProfile); } } } else { - core4.info("Proceeding with IAM user credentials"); + info("Proceeding with IAM user credentials"); if (awsProfile) { if (outputEnvCredentials) { - core4.exportVariable("AWS_PROFILE", awsProfile); + exportVariable("AWS_PROFILE", awsProfile); } } } if (timeoutId) clearTimeout(timeoutId); - } catch (error2) { - core4.setFailed(errorMessage(error2)); + } catch (error3) { + setFailed(errorMessage(error3)); const showStackTrace = process.env.SHOW_STACK_TRACE; if (showStackTrace === "true") { - throw error2; + throw error3; } } } if (require.main === module) { (async () => { await run(); - })().catch((error2) => { - core4.setFailed(errorMessage(error2)); + })().catch((error3) => { + setFailed(errorMessage(error3)); }); } // Annotate the CommonJS export names for ESM import in node: