UNPKG

github-action-readme-generator

Version:

The docs generator for GitHub Actions. Auto-syncs action.yml to README.md with 8 sections: inputs, outputs, usage, badges, branding & more. Works as CLI or GitHub Action.

1,340 lines (1,326 loc) 13.1 MB
#!/usr/bin/env node await(async()=>{let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=i(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=e(globalThis.__filename)),typeof globalThis.require>"u"){let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}})(); var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x5) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x5, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x5)(function(x5) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x5 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from2, except, desc) => { if (from2 && typeof from2 === "object" || typeof from2 === "function") { for (let key of __getOwnPropNames(from2)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable }); } return to2; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // node_modules/@actions/core/lib/utils.js var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toCommandValue = toCommandValue; exports.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"(exports) { "use strict"; var __createBinding = exports && exports.__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 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = exports && exports.__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), i2 = 0; i2 < k.length; i2++) if (k[i2] !== "default") __createBinding(result, mod, k[i2]); } __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.issueCommand = issueCommand; exports.issue = issue; var os2 = __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() + os2.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"(exports) { "use strict"; var __createBinding = exports && exports.__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 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = exports && exports.__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), i2 = 0; i2 < k.length; i2++) if (k[i2] !== "default") __createBinding(result, mod, k[i2]); } __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.issueFileCommand = issueFileCommand; exports.prepareKeyValueMessage = prepareKeyValueMessage; var crypto = __importStar(__require("crypto")); var fs5 = __importStar(__require("fs")); var os2 = __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 (!fs5.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs5.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } function prepareKeyValueMessage(key, value) { const delimiter3 = `ghadelimiter_${crypto.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter3)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter3}"`); } if (convertedValue.includes(delimiter3)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter3}"`); } return `${key}<<${delimiter3}${os2.EOL}${convertedValue}${os2.EOL}${delimiter3}`; } } }); // node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ "node_modules/@actions/http-client/lib/proxy.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProxyUrl = getProxyUrl; exports.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((x5) => x5.trim().toUpperCase()).filter((x5) => x5)) { if (upperNoProxyItem === "*" || upperReqHosts.some((x5) => x5 === upperNoProxyItem || x5.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x5.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"(exports) { "use strict"; var net = __require("net"); var tls = __require("tls"); var http = __require("http"); var https = __require("https"); var events = __require("events"); var assert = __require("assert"); var util = __require("util"); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; exports.httpOverHttps = httpOverHttps; exports.httpsOverHttps = httpsOverHttps; function httpOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } function httpsOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } function httpsOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self2 = this; self2.options = options || {}; self2.proxyOptions = self2.options.proxy || {}; self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets; self2.requests = []; self2.sockets = []; self2.on("free", function onFree(socket, host, port, localAddress) { var options2 = toOptions(host, port, localAddress); for (var i2 = 0, len = self2.requests.length; i2 < len; ++i2) { var pending = self2.requests[i2]; if (pending.host === options2.host && pending.port === options2.port) { self2.requests.splice(i2, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self2.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self2 = this; var options = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); if (self2.sockets.length >= this.maxSockets) { self2.requests.push(options); return; } self2.createSocket(options, function(socket) { socket.on("free", onFree); socket.on("close", onCloseOrRemove); socket.on("agentRemove", onCloseOrRemove); req.onSocket(socket); function onFree() { self2.emit("free", socket, options); } function onCloseOrRemove(err) { self2.removeSocket(socket); socket.removeListener("free", onFree); socket.removeListener("close", onCloseOrRemove); socket.removeListener("agentRemove", onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self2 = this; var placeholder = {}; self2.sockets.push(placeholder); var connectOptions = mergeOptions({}, self2.proxyOptions, { method: "CONNECT", path: options.host + ":" + options.port, agent: false, headers: { host: options.host + ":" + options.port } }); if (options.localAddress) { connectOptions.localAddress = options.localAddress; } if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } debug("making CONNECT request"); var connectReq = self2.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); connectReq.once("upgrade", onUpgrade); connectReq.once("connect", onConnect); connectReq.once("error", onError); connectReq.end(); function onResponse(res) { res.upgrade = true; } function onUpgrade(res, socket, head) { process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug( "tunneling socket could not be established, statusCode=%d", res.statusCode ); socket.destroy(); var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); error2.code = "ECONNRESET"; options.request.emit("error", error2); self2.removeSocket(placeholder); return; } if (head.length > 0) { debug("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); self2.removeSocket(placeholder); return; } debug("tunneling connection has established"); self2.sockets[self2.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack ); var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); error2.code = "ECONNRESET"; options.request.emit("error", error2); self2.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket); if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { this.createSocket(pending, function(socket2) { pending.request.onSocket(socket2); }); } }; function createSecureSocket(options, cb) { var self2 = this; TunnelingAgent.prototype.createSocket.call(self2, options, function(socket) { var hostHeader = options.request.getHeader("host"); var tlsOptions = mergeOptions({}, self2.options, { socket, servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host }); var secureSocket = tls.connect(0, tlsOptions); self2.sockets[self2.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === "string") { return { host, port, localAddress }; } return host; } function mergeOptions(target) { for (var i2 = 1, len = arguments.length; i2 < len; ++i2) { var overrides = arguments[i2]; if (typeof overrides === "object") { var keys = Object.keys(overrides); for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j]; if (overrides[k] !== void 0) { target[k] = overrides[k]; } } } } return target; } var debug; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; } else { args.unshift("TUNNEL:"); } console.error.apply(console, args); }; } else { debug = function() { }; } exports.debug = debug; } }); // node_modules/tunnel/index.js var require_tunnel2 = __commonJS({ "node_modules/tunnel/index.js"(exports, module) { module.exports = require_tunnel(); } }); // node_modules/undici/lib/core/symbols.js var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports, module) { module.exports = { kClose: /* @__PURE__ */ Symbol("close"), kDestroy: /* @__PURE__ */ Symbol("destroy"), kDispatch: /* @__PURE__ */ Symbol("dispatch"), kUrl: /* @__PURE__ */ Symbol("url"), kWriting: /* @__PURE__ */ Symbol("writing"), kResuming: /* @__PURE__ */ Symbol("resuming"), kQueue: /* @__PURE__ */ Symbol("queue"), kConnect: /* @__PURE__ */ Symbol("connect"), kConnecting: /* @__PURE__ */ Symbol("connecting"), kKeepAliveDefaultTimeout: /* @__PURE__ */ Symbol("default keep alive timeout"), kKeepAliveMaxTimeout: /* @__PURE__ */ Symbol("max keep alive timeout"), kKeepAliveTimeoutThreshold: /* @__PURE__ */ Symbol("keep alive timeout threshold"), kKeepAliveTimeoutValue: /* @__PURE__ */ Symbol("keep alive timeout"), kKeepAlive: /* @__PURE__ */ Symbol("keep alive"), kHeadersTimeout: /* @__PURE__ */ Symbol("headers timeout"), kBodyTimeout: /* @__PURE__ */ Symbol("body timeout"), kServerName: /* @__PURE__ */ Symbol("server name"), kLocalAddress: /* @__PURE__ */ Symbol("local address"), kHost: /* @__PURE__ */ Symbol("host"), kNoRef: /* @__PURE__ */ Symbol("no ref"), kBodyUsed: /* @__PURE__ */ Symbol("used"), kBody: /* @__PURE__ */ Symbol("abstracted request body"), kRunning: /* @__PURE__ */ Symbol("running"), kBlocking: /* @__PURE__ */ Symbol("blocking"), kPending: /* @__PURE__ */ Symbol("pending"), kSize: /* @__PURE__ */ Symbol("size"), kBusy: /* @__PURE__ */ Symbol("busy"), kQueued: /* @__PURE__ */ Symbol("queued"), kFree: /* @__PURE__ */ Symbol("free"), kConnected: /* @__PURE__ */ Symbol("connected"), kClosed: /* @__PURE__ */ Symbol("closed"), kNeedDrain: /* @__PURE__ */ Symbol("need drain"), kReset: /* @__PURE__ */ Symbol("reset"), kDestroyed: /* @__PURE__ */ Symbol.for("nodejs.stream.destroyed"), kResume: /* @__PURE__ */ Symbol("resume"), kOnError: /* @__PURE__ */ Symbol("on error"), kMaxHeadersSize: /* @__PURE__ */ Symbol("max headers size"), kRunningIdx: /* @__PURE__ */ Symbol("running index"), kPendingIdx: /* @__PURE__ */ Symbol("pending index"), kError: /* @__PURE__ */ Symbol("error"), kClients: /* @__PURE__ */ Symbol("clients"), kClient: /* @__PURE__ */ Symbol("client"), kParser: /* @__PURE__ */ Symbol("parser"), kOnDestroyed: /* @__PURE__ */ Symbol("destroy callbacks"), kPipelining: /* @__PURE__ */ Symbol("pipelining"), kSocket: /* @__PURE__ */ Symbol("socket"), kHostHeader: /* @__PURE__ */ Symbol("host header"), kConnector: /* @__PURE__ */ Symbol("connector"), kStrictContentLength: /* @__PURE__ */ Symbol("strict content length"), kMaxRedirections: /* @__PURE__ */ Symbol("maxRedirections"), kMaxRequests: /* @__PURE__ */ Symbol("maxRequestsPerClient"), kProxy: /* @__PURE__ */ Symbol("proxy agent options"), kCounter: /* @__PURE__ */ Symbol("socket request counter"), kInterceptors: /* @__PURE__ */ Symbol("dispatch interceptors"), kMaxResponseSize: /* @__PURE__ */ Symbol("max response size"), kHTTP2Session: /* @__PURE__ */ Symbol("http2Session"), kHTTP2SessionState: /* @__PURE__ */ Symbol("http2Session state"), kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), kConstruct: /* @__PURE__ */ Symbol("constructable"), kListeners: /* @__PURE__ */ Symbol("listeners"), kHTTPContext: /* @__PURE__ */ Symbol("http context"), kMaxConcurrentStreams: /* @__PURE__ */ Symbol("max concurrent streams"), kNoProxyAgent: /* @__PURE__ */ Symbol("no proxy agent"), kHttpProxyAgent: /* @__PURE__ */ Symbol("http proxy agent"), kHttpsProxyAgent: /* @__PURE__ */ Symbol("https proxy agent") }; } }); // node_modules/undici/lib/core/errors.js var require_errors = __commonJS({ "node_modules/undici/lib/core/errors.js"(exports, module) { "use strict"; var kUndiciError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR"); var UndiciError = class extends Error { constructor(message) { super(message); this.name = "UndiciError"; this.code = "UND_ERR"; } static [Symbol.hasInstance](instance) { return instance && instance[kUndiciError] === true; } [kUndiciError] = true; }; var kConnectTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); var ConnectTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "ConnectTimeoutError"; this.message = message || "Connect Timeout Error"; this.code = "UND_ERR_CONNECT_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kConnectTimeoutError] === true; } [kConnectTimeoutError] = true; }; var kHeadersTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); var HeadersTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "HeadersTimeoutError"; this.message = message || "Headers Timeout Error"; this.code = "UND_ERR_HEADERS_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kHeadersTimeoutError] === true; } [kHeadersTimeoutError] = true; }; var kHeadersOverflowError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); var HeadersOverflowError = class extends UndiciError { constructor(message) { super(message); this.name = "HeadersOverflowError"; this.message = message || "Headers Overflow Error"; this.code = "UND_ERR_HEADERS_OVERFLOW"; } static [Symbol.hasInstance](instance) { return instance && instance[kHeadersOverflowError] === true; } [kHeadersOverflowError] = true; }; var kBodyTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); var BodyTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "BodyTimeoutError"; this.message = message || "Body Timeout Error"; this.code = "UND_ERR_BODY_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kBodyTimeoutError] === true; } [kBodyTimeoutError] = true; }; var kResponseStatusCodeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); var ResponseStatusCodeError = class extends UndiciError { constructor(message, statusCode, headers, body) { super(message); this.name = "ResponseStatusCodeError"; this.message = message || "Response Status Code Error"; this.code = "UND_ERR_RESPONSE_STATUS_CODE"; this.body = body; this.status = statusCode; this.statusCode = statusCode; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseStatusCodeError] === true; } [kResponseStatusCodeError] = true; }; var kInvalidArgumentError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_ARG"); var InvalidArgumentError = class extends UndiciError { constructor(message) { super(message); this.name = "InvalidArgumentError"; this.message = message || "Invalid Argument Error"; this.code = "UND_ERR_INVALID_ARG"; } static [Symbol.hasInstance](instance) { return instance && instance[kInvalidArgumentError] === true; } [kInvalidArgumentError] = true; }; var kInvalidReturnValueError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); var InvalidReturnValueError = class extends UndiciError { constructor(message) { super(message); this.name = "InvalidReturnValueError"; this.message = message || "Invalid Return Value Error"; this.code = "UND_ERR_INVALID_RETURN_VALUE"; } static [Symbol.hasInstance](instance) { return instance && instance[kInvalidReturnValueError] === true; } [kInvalidReturnValueError] = true; }; var kAbortError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORT"); var AbortError = class extends UndiciError { constructor(message) { super(message); this.name = "AbortError"; this.message = message || "The operation was aborted"; this.code = "UND_ERR_ABORT"; } static [Symbol.hasInstance](instance) { return instance && instance[kAbortError] === true; } [kAbortError] = true; }; var kRequestAbortedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORTED"); var RequestAbortedError = class extends AbortError { constructor(message) { super(message); this.name = "AbortError"; this.message = message || "Request aborted"; this.code = "UND_ERR_ABORTED"; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestAbortedError] === true; } [kRequestAbortedError] = true; }; var kInformationalError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INFO"); var InformationalError = class extends UndiciError { constructor(message) { super(message); this.name = "InformationalError"; this.message = message || "Request information"; this.code = "UND_ERR_INFO"; } static [Symbol.hasInstance](instance) { return instance && instance[kInformationalError] === true; } [kInformationalError] = true; }; var kRequestContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); var RequestContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); this.name = "RequestContentLengthMismatchError"; this.message = message || "Request body length does not match content-length header"; this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestContentLengthMismatchError] === true; } [kRequestContentLengthMismatchError] = true; }; var kResponseContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); var ResponseContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); this.name = "ResponseContentLengthMismatchError"; this.message = message || "Response body length does not match content-length header"; this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseContentLengthMismatchError] === true; } [kResponseContentLengthMismatchError] = true; }; var kClientDestroyedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_DESTROYED"); var ClientDestroyedError = class extends UndiciError { constructor(message) { super(message); this.name = "ClientDestroyedError"; this.message = message || "The client is destroyed"; this.code = "UND_ERR_DESTROYED"; } static [Symbol.hasInstance](instance) { return instance && instance[kClientDestroyedError] === true; } [kClientDestroyedError] = true; }; var kClientClosedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CLOSED"); var ClientClosedError = class extends UndiciError { constructor(message) { super(message); this.name = "ClientClosedError"; this.message = message || "The client is closed"; this.code = "UND_ERR_CLOSED"; } static [Symbol.hasInstance](instance) { return instance && instance[kClientClosedError] === true; } [kClientClosedError] = true; }; var kSocketError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_SOCKET"); var SocketError = class extends UndiciError { constructor(message, socket) { super(message); this.name = "SocketError"; this.message = message || "Socket error"; this.code = "UND_ERR_SOCKET"; this.socket = socket; } static [Symbol.hasInstance](instance) { return instance && instance[kSocketError] === true; } [kSocketError] = true; }; var kNotSupportedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); var NotSupportedError = class extends UndiciError { constructor(message) { super(message); this.name = "NotSupportedError"; this.message = message || "Not supported error"; this.code = "UND_ERR_NOT_SUPPORTED"; } static [Symbol.hasInstance](instance) { return instance && instance[kNotSupportedError] === true; } [kNotSupportedError] = true; }; var kBalancedPoolMissingUpstreamError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); var BalancedPoolMissingUpstreamError = class extends UndiciError { constructor(message) { super(message); this.name = "MissingUpstreamError"; this.message = message || "No upstream has been added to the BalancedPool"; this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; } static [Symbol.hasInstance](instance) { return instance && instance[kBalancedPoolMissingUpstreamError] === true; } [kBalancedPoolMissingUpstreamError] = true; }; var kHTTPParserError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); var HTTPParserError = class extends Error { constructor(message, code, data2) { super(message); this.name = "HTTPParserError"; this.code = code ? `HPE_${code}` : void 0; this.data = data2 ? data2.toString() : void 0; } static [Symbol.hasInstance](instance) { return instance && instance[kHTTPParserError] === true; } [kHTTPParserError] = true; }; var kResponseExceededMaxSizeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); var ResponseExceededMaxSizeError = class extends UndiciError { constructor(message) { super(message); this.name = "ResponseExceededMaxSizeError"; this.message = message || "Response content exceeded max size"; this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseExceededMaxSizeError] === true; } [kResponseExceededMaxSizeError] = true; }; var kRequestRetryError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_RETRY"); var RequestRetryError = class extends UndiciError { constructor(message, code, { headers, data: data2 }) { super(message); this.name = "RequestRetryError"; this.message = message || "Request retry error"; this.code = "UND_ERR_REQ_RETRY"; this.statusCode = code; this.data = data2; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestRetryError] === true; } [kRequestRetryError] = true; }; var kResponseError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE"); var ResponseError = class extends UndiciError { constructor(message, code, { headers, data: data2 }) { super(message); this.name = "ResponseError"; this.message = message || "Response error"; this.code = "UND_ERR_RESPONSE"; this.statusCode = code; this.data = data2; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseError] === true; } [kResponseError] = true; }; var kSecureProxyConnectionError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_PRX_TLS"); var SecureProxyConnectionError = class extends UndiciError { constructor(cause, message, options) { super(message, { cause, ...options ?? {} }); this.name = "SecureProxyConnectionError"; this.message = message || "Secure Proxy Connection failed"; this.code = "UND_ERR_PRX_TLS"; this.cause = cause; } static [Symbol.hasInstance](instance) { return instance && instance[kSecureProxyConnectionError] === true; } [kSecureProxyConnectionError] = true; }; module.exports = { AbortError, HTTPParserError, UndiciError, HeadersTimeoutError, HeadersOverflowError, BodyTimeoutError, RequestContentLengthMismatchError, ConnectTimeoutError, ResponseStatusCodeError, InvalidArgumentError, InvalidReturnValueError, RequestAbortedError, ClientDestroyedError, ClientClosedError, InformationalError, SocketError, NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, ResponseExceededMaxSizeError, RequestRetryError, ResponseError, SecureProxyConnectionError }; } }); // node_modules/undici/lib/core/constants.js var require_constants = __commonJS({ "node_modules/undici/lib/core/constants.js"(exports, module) { "use strict"; var headerNameLowerCasedRecord = {}; var wellknownHeaderNames = [ "Accept", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Access-Control-Allow-Credentials", "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", "Access-Control-Request-Headers", "Access-Control-Request-Method", "Age", "Allow", "Alt-Svc", "Alt-Used", "Authorization", "Cache-Control", "Clear-Site-Data", "Connection", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-Range", "Content-Security-Policy", "Content-Security-Policy-Report-Only", "Content-Type", "Cookie", "Cross-Origin-Embedder-Policy", "Cross-Origin-Opener-Policy", "Cross-Origin-Resource-Policy", "Date", "Device-Memory", "Downlink", "ECT", "ETag", "Expect", "Expect-CT", "Expires", "Forwarded", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match", "If-Range", "If-Unmodified-Since", "Keep-Alive", "Last-Modified", "Link", "Location", "Max-Forwards", "Origin", "Permissions-Policy", "Pragma", "Proxy-Authenticate", "Proxy-Authorization", "RTT", "Range", "Referer", "Referrer-Policy", "Refresh", "Retry-After", "Sec-WebSocket-Accept", "Sec-WebSocket-Extensions", "Sec-WebSocket-Key", "Sec-WebSocket-Protocol", "Sec-WebSocket-Version", "Server", "Server-Timing", "Service-Worker-Allowed", "Service-Worker-Navigation-Preload", "Set-Cookie", "SourceMap", "Strict-Transport-Security", "Supports-Loading-Mode", "TE", "Timing-Allow-Origin", "Trailer", "Transfer-Encoding", "Upgrade", "Upgrade-Insecure-Requests", "User-Agent", "Vary", "Via", "WWW-Authenticate", "X-Content-Type-Options", "X-DNS-Prefetch-Control", "X-Frame-Options", "X-Permitted-Cross-Domain-Policies", "X-Powered-By", "X-Requested-With", "X-XSS-Protection" ]; for (let i2 = 0; i2 < wellknownHeaderNames.length; ++i2) { const key = wellknownHeaderNames[i2]; const lowerCasedKey = key.toLowerCase(); headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; } Object.setPrototypeOf(headerNameLowerCasedRecord, null); module.exports = { wellknownHeaderNames, headerNameLowerCasedRecord }; } }); // node_modules/undici/lib/core/tree.js var require_tree = __commonJS({ "node_modules/undici/lib/core/tree.js"(exports, module) { "use strict"; var { wellknownHeaderNames, headerNameLowerCasedRecord } = require_constants(); var TstNode = class _TstNode { /** @type {any} */ value = null; /** @type {null | TstNode} */ left = null; /** @type {null | TstNode} */ middle = null; /** @type {null | TstNode} */ right = null; /** @type {number} */ code; /** * @param {string} key * @param {any} value * @param {number} index */ constructor(key, value, index) { if (index === void 0 || index >= key.length) { throw new TypeError("Unreachable"); } const code = this.code = key.charCodeAt(index); if (code > 127) { throw new TypeError("key must be ascii string"); } if (key.length !== ++index) { this.middle = new _TstNode(key, value, index); } else { this.value = value; } } /** * @param {string} key * @param {any} value */ add(key, value) { const length3 = key.length; if (length3 === 0) { throw new TypeError("Unreachable"); } let index = 0; let node2 = this; while (true) { const code = key.charCodeAt(index); if (code > 127) { throw new TypeError("key must be ascii string"); } if (node2.code === code) { if (length3 === ++index) { node2.value = value; break; } else if (node2.middle !== null) { node2 = node2.middle; } else { node2.middle = new _TstNode(key, value, index); break; } } else if (node2.code < code) { if (node2.left !== null) { node2 = node2.left; } else { node2.left = new _TstNode(key, value, index); break; } } else if (node2.right !== null) { node2 = node2.right; } else { node2.right = new _TstNode(key, value, index); break; } } } /** * @param {Uint8Array} key * @return {TstNode | null} */ search(key) { const keylength = key.length; let index = 0; let node2 = this; while (node2 !== null && index < keylength) { let code = key[index]; if (code <= 90 && code >= 65) { code |= 32; } while (node2 !== null) { if (code === node2.code) { if (keylength === ++index) { return node2; } node2 = node2.middle; break; } node2 = node2.code < code ? node2.left : node2.right; } } return null; } }; var TernarySearchTree = class { /** @type {TstNode | null} */ node = null; /** * @param {string} key * @param {any} value * */ insert(key, value) { if (this.node === null) { this.node = new TstNode(key, value, 0); } else { this.node.add(key, value); } } /** * @param {Uint8Array} key * @return {any} */ lookup(key) { return this.node?.search(key)?.value ?? null; } }; var tree = new TernarySearchTree(); for (let i2 = 0; i2 < wellknownHeaderNames.length; ++i2) { const key = headerNameLowerCasedRecord[wellknownHeaderNames[i2]]; tree.insert(key, key); } module.exports = { TernarySearchTree, tree }; } }); // node_modules/undici/lib/core/util.js var require_util = __commonJS({ "node_modules/undici/lib/core/util.js"(exports, module) { "use strict"; var assert = __require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); var { IncomingMessage } = __require("node:http"); var stream = __require("node:stream"); var net = __require("node:net"); var { Blob: Blob2 } = __require("node:buffer"); var nodeUtil = __require("node:util"); var { stringify } = __require("node:querystring"); var { EventEmitter: EE } = __require("node:events"); var { InvalidArgumentError } = require_errors(); var { headerNameLowerCasedRecord } = require_constants(); var { tree } = require_tree(); var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { assert(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } }; function wrapRequestBody(body) { if (isStream(body)) { if (bodyLength(body) === 0) { body.on("data", function() { assert(false); }); } if (typeof body.readableDidRead !== "boolean") { body[kBodyUsed] = false; EE.prototype.on.call(body, "data", function() { this[kBodyUsed] = true; }); } return body; } else if (body && typeof body.pipeTo === "function") { return new BodyAsyncIterable(body); } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) { return new BodyAsyncIterable(body); } else { return body; } } function nop() { } function isStream(obj) { return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; } function isBlobLike(object) { if (object === null) { return false; } else if (object instanceof Blob2) { return true; } else if (typeof object !== "object") { return false; } else { const sTag = object[Symbol.toStringTag]; return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function"); } } function buildURL(url, queryParams) { if (url.includes("?") || url.includes("#")) { throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } const stringified = stringify(queryParams); if (stringified) { url += "?" + stringified; } return url; } function isValidPort(port) { const value = parseInt(port, 10); return value === Number(port) && value >= 0 && value <= 65535; } function isHttpOrHttpsPrefixed(value) { return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); } function parseURL(url) { if (typeof url === "string") { url = new URL(url); if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } return url; } if (!url || typeof url !== "object") { throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); } if (!(url instanceof URL)) { if (url.port != null && url.port !== "" && isValidPort(url.port) === false) { throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); } if (url.path != null && typeof url.path !== "string") { throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); } if (url.pathname != null && typeof url.pathname !== "string") { throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); } if (url.hostname != null && typeof url.hostname !== "string") { throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); } if (url.origin != null && typeof url.origin !== "string") { throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); }