neiam
/action-setup-beam
action-setup-beam
public · Issues · Pulls · Labels · Forks · Compare · Actions failure · Badges
⭐
Log in to mark this repository.
Bump @eslint/js from 9.38.0 to 10.0.1 (#404)
b8fc6e4 · dependabot[bot] · 2026-03-02 21:33
Message
{commit_body(@commit)}
Files changed
modified
dist/index.js
+25104
−1117
@@ -1946,7 +1946,11 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand
| 1946 | 1946 | /* eslint-disable @typescript-eslint/no-explicit-any */ |
| 1947 | 1947 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
| 1948 | 1948 | if (k2 === undefined) k2 = k; |
| 1949 | − Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | |
| 1949 | + var desc = Object.getOwnPropertyDescriptor(m, k); | |
| 1950 | + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | |
| 1951 | + desc = { enumerable: true, get: function() { return m[k]; } }; | |
| 1952 | + } | |
| 1953 | + Object.defineProperty(o, k2, desc); | |
| 1950 | 1954 | }) : (function(o, m, k, k2) { |
| 1951 | 1955 | if (k2 === undefined) k2 = k; |
| 1952 | 1956 | o[k2] = m[k]; |
@@ -1959,7 +1963,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
| 1959 | 1963 | var __importStar = (this && this.__importStar) || function (mod) { |
| 1960 | 1964 | if (mod && mod.__esModule) return mod; |
| 1961 | 1965 | var result = {}; |
| 1962 | − if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | |
| 1966 | + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | |
| 1963 | 1967 | __setModuleDefault(result, mod); |
| 1964 | 1968 | return result; |
| 1965 | 1969 | }; |
@@ -1978,6 +1982,7 @@ const http = __importStar(__nccwpck_require__(8611));
| 1978 | 1982 | const https = __importStar(__nccwpck_require__(5692)); |
| 1979 | 1983 | const pm = __importStar(__nccwpck_require__(4988)); |
| 1980 | 1984 | const tunnel = __importStar(__nccwpck_require__(770)); |
| 1985 | +const undici_1 = __nccwpck_require__(6752); | |
| 1981 | 1986 | var HttpCodes; |
| 1982 | 1987 | (function (HttpCodes) { |
| 1983 | 1988 | HttpCodes[HttpCodes["OK"] = 200] = "OK"; |
@@ -2007,16 +2012,16 @@ var HttpCodes;
| 2007 | 2012 | HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; |
| 2008 | 2013 | HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; |
| 2009 | 2014 | HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; |
| 2010 | −})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); | |
| 2015 | +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); | |
| 2011 | 2016 | var Headers; |
| 2012 | 2017 | (function (Headers) { |
| 2013 | 2018 | Headers["Accept"] = "accept"; |
| 2014 | 2019 | Headers["ContentType"] = "content-type"; |
| 2015 | −})(Headers = exports.Headers || (exports.Headers = {})); | |
| 2020 | +})(Headers || (exports.Headers = Headers = {})); | |
| 2016 | 2021 | var MediaTypes; |
| 2017 | 2022 | (function (MediaTypes) { |
| 2018 | 2023 | MediaTypes["ApplicationJson"] = "application/json"; |
| 2019 | −})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); | |
| 2024 | +})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); | |
| 2020 | 2025 | /** |
| 2021 | 2026 | * Returns the proxy URL, depending upon the supplied url and proxy environment variables. |
| 2022 | 2027 | * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com |
@@ -2067,6 +2072,19 @@ class HttpClientResponse {
| 2067 | 2072 | })); |
| 2068 | 2073 | }); |
| 2069 | 2074 | } |
| 2075 | + readBodyBuffer() { | |
| 2076 | + return __awaiter(this, void 0, void 0, function* () { | |
| 2077 | + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { | |
| 2078 | + const chunks = []; | |
| 2079 | + this.message.on('data', (chunk) => { | |
| 2080 | + chunks.push(chunk); | |
| 2081 | + }); | |
| 2082 | + this.message.on('end', () => { | |
| 2083 | + resolve(Buffer.concat(chunks)); | |
| 2084 | + }); | |
| 2085 | + })); | |
| 2086 | + }); | |
| 2087 | + } | |
| 2070 | 2088 | } |
| 2071 | 2089 | exports.HttpClientResponse = HttpClientResponse; |
| 2072 | 2090 | function isHttps(requestUrl) { |
@@ -2372,6 +2390,15 @@ class HttpClient {
| 2372 | 2390 | const parsedUrl = new URL(serverUrl); |
| 2373 | 2391 | return this._getAgent(parsedUrl); |
| 2374 | 2392 | } |
| 2393 | + getAgentDispatcher(serverUrl) { | |
| 2394 | + const parsedUrl = new URL(serverUrl); | |
| 2395 | + const proxyUrl = pm.getProxyUrl(parsedUrl); | |
| 2396 | + const useProxy = proxyUrl && proxyUrl.hostname; | |
| 2397 | + if (!useProxy) { | |
| 2398 | + return; | |
| 2399 | + } | |
| 2400 | + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); | |
| 2401 | + } | |
| 2375 | 2402 | _prepareRequest(method, requestUrl, headers) { |
| 2376 | 2403 | const info = {}; |
| 2377 | 2404 | info.parsedUrl = requestUrl; |
@@ -2419,7 +2446,7 @@ class HttpClient {
| 2419 | 2446 | if (this._keepAlive && useProxy) { |
| 2420 | 2447 | agent = this._proxyAgent; |
| 2421 | 2448 | } |
| 2422 | − if (this._keepAlive && !useProxy) { | |
| 2449 | + if (!useProxy) { | |
| 2423 | 2450 | agent = this._agent; |
| 2424 | 2451 | } |
| 2425 | 2452 | // if agent is already assigned use that agent. |
@@ -2451,16 +2478,12 @@ class HttpClient {
| 2451 | 2478 | agent = tunnelAgent(agentOptions); |
| 2452 | 2479 | this._proxyAgent = agent; |
| 2453 | 2480 | } |
| 2454 | − // if reusing agent across request and tunneling agent isn't assigned create a new agent | |
| 2455 | − if (this._keepAlive && !agent) { | |
| 2481 | + // if tunneling agent isn't assigned create a new agent | |
| 2482 | + if (!agent) { | |
| 2456 | 2483 | const options = { keepAlive: this._keepAlive, maxSockets }; |
| 2457 | 2484 | agent = usingSsl ? new https.Agent(options) : new http.Agent(options); |
| 2458 | 2485 | this._agent = agent; |
| 2459 | 2486 | } |
| 2460 | − // if not using private agent and tunnel agent isn't setup then use global agent | |
| 2461 | − if (!agent) { | |
| 2462 | − agent = usingSsl ? https.globalAgent : http.globalAgent; | |
| 2463 | − } | |
| 2464 | 2487 | if (usingSsl && this._ignoreSslError) { |
| 2465 | 2488 | // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process |
| 2466 | 2489 | // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options |
@@ -2471,6 +2494,30 @@ class HttpClient {
| 2471 | 2494 | } |
| 2472 | 2495 | return agent; |
| 2473 | 2496 | } |
| 2497 | + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { | |
| 2498 | + let proxyAgent; | |
| 2499 | + if (this._keepAlive) { | |
| 2500 | + proxyAgent = this._proxyAgentDispatcher; | |
| 2501 | + } | |
| 2502 | + // if agent is already assigned use that agent. | |
| 2503 | + if (proxyAgent) { | |
| 2504 | + return proxyAgent; | |
| 2505 | + } | |
| 2506 | + const usingSsl = parsedUrl.protocol === 'https:'; | |
| 2507 | + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { | |
| 2508 | + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` | |
| 2509 | + }))); | |
| 2510 | + this._proxyAgentDispatcher = proxyAgent; | |
| 2511 | + if (usingSsl && this._ignoreSslError) { | |
| 2512 | + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process | |
| 2513 | + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options | |
| 2514 | + // we have to cast it to any and change it directly | |
| 2515 | + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { | |
| 2516 | + rejectUnauthorized: false | |
| 2517 | + }); | |
| 2518 | + } | |
| 2519 | + return proxyAgent; | |
| 2520 | + } | |
| 2474 | 2521 | _performExponentialBackoff(retryNumber) { |
| 2475 | 2522 | return __awaiter(this, void 0, void 0, function* () { |
| 2476 | 2523 | retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); |
@@ -2571,7 +2618,13 @@ function getProxyUrl(reqUrl) {
| 2571 | 2618 | } |
| 2572 | 2619 | })(); |
| 2573 | 2620 | if (proxyVar) { |
| 2574 | − return new URL(proxyVar); | |
| 2621 | + try { | |
| 2622 | + return new DecodedURL(proxyVar); | |
| 2623 | + } | |
| 2624 | + catch (_a) { | |
| 2625 | + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) | |
| 2626 | + return new DecodedURL(`http://${proxyVar}`); | |
| 2627 | + } | |
| 2575 | 2628 | } |
| 2576 | 2629 | else { |
| 2577 | 2630 | return undefined; |
@@ -2629,6 +2682,19 @@ function isLoopbackAddress(host) {
| 2629 | 2682 | hostLower.startsWith('[::1]') || |
| 2630 | 2683 | hostLower.startsWith('[0:0:0:0:0:0:0:1]')); |
| 2631 | 2684 | } |
| 2685 | +class DecodedURL extends URL { | |
| 2686 | + constructor(url, base) { | |
| 2687 | + super(url, base); | |
| 2688 | + this._decodedUsername = decodeURIComponent(super.username); | |
| 2689 | + this._decodedPassword = decodeURIComponent(super.password); | |
| 2690 | + } | |
| 2691 | + get username() { | |
| 2692 | + return this._decodedUsername; | |
| 2693 | + } | |
| 2694 | + get password() { | |
| 2695 | + return this._decodedPassword; | |
| 2696 | + } | |
| 2697 | +} | |
| 2632 | 2698 | //# sourceMappingURL=proxy.js.map |
| 2633 | 2699 | |
| 2634 | 2700 | /***/ }), |
@@ -25914,1380 +25980,25301 @@ exports.debug = debug; // for test
| 25914 | 25980 | |
| 25915 | 25981 | /***/ }), |
| 25916 | 25982 | |
| 25917 | −/***/ 9890: | |
| 25983 | +/***/ 6752: | |
| 25918 | 25984 | /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { |
| 25919 | 25985 | |
| 25920 | −const core = __nccwpck_require__(7484) | |
| 25921 | −const { exec } = __nccwpck_require__(5236) | |
| 25922 | −const tc = __nccwpck_require__(3472) | |
| 25923 | −const path = __nccwpck_require__(6928) | |
| 25924 | −const semver = __nccwpck_require__(2088) | |
| 25925 | −const fs = __nccwpck_require__(9896) | |
| 25926 | −const os = __nccwpck_require__(857) | |
| 25927 | −const csv = __nccwpck_require__(1110) | |
| 25928 | −const _ = __nccwpck_require__(2356) | |
| 25986 | +"use strict"; | |
| 25929 | 25987 | |
| 25930 | −const MAX_HTTP_RETRIES = 3 | |
| 25931 | 25988 | |
| 25932 | −if (process.env.NODE_ENV !== 'test') { | |
| 25933 | − main().catch((err) => { | |
| 25934 | − core.setFailed(err.message) | |
| 25935 | − }) | |
| 25989 | +const Client = __nccwpck_require__(6197) | |
| 25990 | +const Dispatcher = __nccwpck_require__(992) | |
| 25991 | +const errors = __nccwpck_require__(8707) | |
| 25992 | +const Pool = __nccwpck_require__(5076) | |
| 25993 | +const BalancedPool = __nccwpck_require__(1093) | |
| 25994 | +const Agent = __nccwpck_require__(9965) | |
| 25995 | +const util = __nccwpck_require__(3440) | |
| 25996 | +const { InvalidArgumentError } = errors | |
| 25997 | +const api = __nccwpck_require__(6615) | |
| 25998 | +const buildConnector = __nccwpck_require__(9136) | |
| 25999 | +const MockClient = __nccwpck_require__(7365) | |
| 26000 | +const MockAgent = __nccwpck_require__(7501) | |
| 26001 | +const MockPool = __nccwpck_require__(4004) | |
| 26002 | +const mockErrors = __nccwpck_require__(2429) | |
| 26003 | +const ProxyAgent = __nccwpck_require__(2720) | |
| 26004 | +const RetryHandler = __nccwpck_require__(3573) | |
| 26005 | +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(2581) | |
| 26006 | +const DecoratorHandler = __nccwpck_require__(8840) | |
| 26007 | +const RedirectHandler = __nccwpck_require__(8299) | |
| 26008 | +const createRedirectInterceptor = __nccwpck_require__(4415) | |
| 26009 | + | |
| 26010 | +let hasCrypto | |
| 26011 | +try { | |
| 26012 | + __nccwpck_require__(6982) | |
| 26013 | + hasCrypto = true | |
| 26014 | +} catch { | |
| 26015 | + hasCrypto = false | |
| 25936 | 26016 | } |
| 25937 | 26017 | |
| 25938 | −async function main() { | |
| 25939 | − checkOtpArchitecture() | |
| 26018 | +Object.assign(Dispatcher.prototype, api) | |
| 25940 | 26019 | |
| 25941 | − const versionFilePath = getInput('version-file', false) | |
| 25942 | − let versions | |
| 25943 | − if (versionFilePath) { | |
| 25944 | − if (!isStrictVersion()) { | |
| 25945 | − throw new Error( | |
| 25946 | − "you have to set version-type=strict if you're using version-file", | |
| 25947 | − ) | |
| 25948 | − } | |
| 25949 | − versions = parseVersionFile(versionFilePath) | |
| 25950 | − } | |
| 26020 | +module.exports.Dispatcher = Dispatcher | |
| 26021 | +module.exports.Client = Client | |
| 26022 | +module.exports.Pool = Pool | |
| 26023 | +module.exports.BalancedPool = BalancedPool | |
| 26024 | +module.exports.Agent = Agent | |
| 26025 | +module.exports.ProxyAgent = ProxyAgent | |
| 26026 | +module.exports.RetryHandler = RetryHandler | |
| 25951 | 26027 | |
| 25952 | − const otpSpec = getInput('otp-version', true, 'erlang', versions) | |
| 25953 | − const elixirSpec = getInput('elixir-version', false, 'elixir', versions) | |
| 25954 | − const gleamSpec = getInput('gleam-version', false, 'gleam', versions) | |
| 25955 | − const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions) | |
| 26028 | +module.exports.DecoratorHandler = DecoratorHandler | |
| 26029 | +module.exports.RedirectHandler = RedirectHandler | |
| 26030 | +module.exports.createRedirectInterceptor = createRedirectInterceptor | |
| 25956 | 26031 | |
| 25957 | − if (otpSpec !== 'false') { | |
| 25958 | − await installOTP(otpSpec) | |
| 25959 | − const elixirInstalled = await maybeInstallElixir(elixirSpec) | |
| 25960 | − if (elixirInstalled === true) { | |
| 25961 | − const shouldMixRebar = getInput('install-rebar', false) | |
| 25962 | − await mix(shouldMixRebar, 'rebar') | |
| 26032 | +module.exports.buildConnector = buildConnector | |
| 26033 | +module.exports.errors = errors | |
| 25963 | 26034 | |
| 25964 | − const shouldMixHex = getInput('install-hex', false) | |
| 25965 | − await mix(shouldMixHex, 'hex') | |
| 26035 | +function makeDispatcher (fn) { | |
| 26036 | + return (url, opts, handler) => { | |
| 26037 | + if (typeof opts === 'function') { | |
| 26038 | + handler = opts | |
| 26039 | + opts = null | |
| 25966 | 26040 | } |
| 25967 | − } else if (!gleamSpec) { | |
| 25968 | − throw new Error('otp-version=false is only available when installing Gleam') | |
| 25969 | − } | |
| 25970 | 26041 | |
| 25971 | − await maybeInstallGleam(gleamSpec) | |
| 25972 | − await maybeInstallRebar3(rebar3Spec) | |
| 26042 | + if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { | |
| 26043 | + throw new InvalidArgumentError('invalid url') | |
| 26044 | + } | |
| 25973 | 26045 | |
| 25974 | − // undefined is replaced by a function, post- main branch merge | |
| 25975 | − const setupBeamVersion = 'a50e3e2' | |
| 25976 | − core.setOutput('setup-beam-version', setupBeamVersion) | |
| 25977 | −} | |
| 26046 | + if (opts != null && typeof opts !== 'object') { | |
| 26047 | + throw new InvalidArgumentError('invalid opts') | |
| 26048 | + } | |
| 25978 | 26049 | |
| 25979 | −async function installOTP(otpSpec) { | |
| 25980 | − const osVersion = getRunnerOSVersion() | |
| 25981 | − const otpVersion = await getOTPVersion(otpSpec, osVersion) | |
| 25982 | − core.startGroup( | |
| 25983 | − `Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`, | |
| 25984 | − ) | |
| 25985 | − await doWithMirrors({ | |
| 25986 | − hexMirrors: hexMirrorsInput(), | |
| 25987 | − actionTitle: `install Erlang/OTP ${otpVersion}`, | |
| 25988 | − action: async (hexMirror) => { | |
| 25989 | − await install('otp', { | |
| 25990 | − osVersion, | |
| 25991 | − toolVersion: otpVersion, | |
| 25992 | − hexMirror, | |
| 25993 | − }) | |
| 25994 | − }, | |
| 25995 | − }) | |
| 25996 | − core.setOutput('otp-version', otpVersion) | |
| 25997 | − core.endGroup() | |
| 26050 | + if (opts && opts.path != null) { | |
| 26051 | + if (typeof opts.path !== 'string') { | |
| 26052 | + throw new InvalidArgumentError('invalid opts.path') | |
| 26053 | + } | |
| 25998 | 26054 | |
| 25999 | − return otpVersion | |
| 26000 | −} | |
| 26055 | + let path = opts.path | |
| 26056 | + if (!opts.path.startsWith('/')) { | |
| 26057 | + path = `/${path}` | |
| 26058 | + } | |
| 26001 | 26059 | |
| 26002 | −async function maybeInstallElixir(elixirSpec) { | |
| 26003 | − let installed = false | |
| 26004 | − if (elixirSpec) { | |
| 26005 | − const elixirVersion = await getElixirVersion(elixirSpec) | |
| 26006 | − core.startGroup(`Installing Elixir ${elixirVersion}`) | |
| 26007 | − await doWithMirrors({ | |
| 26008 | − hexMirrors: hexMirrorsInput(), | |
| 26009 | − actionTitle: `install Elixir ${elixirVersion}`, | |
| 26010 | − action: async (hexMirror) => { | |
| 26011 | − await install('elixir', { | |
| 26012 | − toolVersion: elixirVersion, | |
| 26013 | − hexMirror, | |
| 26014 | − }) | |
| 26015 | − }, | |
| 26016 | − }) | |
| 26017 | − core.setOutput('elixir-version', elixirVersion) | |
| 26018 | − maybeEnableElixirProblemMatchers() | |
| 26019 | − core.endGroup() | |
| 26060 | + url = new URL(util.parseOrigin(url).origin + path) | |
| 26061 | + } else { | |
| 26062 | + if (!opts) { | |
| 26063 | + opts = typeof url === 'object' ? url : {} | |
| 26064 | + } | |
| 26020 | 26065 | |
| 26021 | − installed = true | |
| 26022 | − } | |
| 26066 | + url = util.parseURL(url) | |
| 26067 | + } | |
| 26023 | 26068 | |
| 26024 | − return installed | |
| 26025 | −} | |
| 26069 | + const { agent, dispatcher = getGlobalDispatcher() } = opts | |
| 26026 | 26070 | |
| 26027 | −function maybeEnableElixirProblemMatchers() { | |
| 26028 | − const disableProblemMatchers = getInput('disable_problem_matchers', false) | |
| 26029 | − if (disableProblemMatchers === 'false') { | |
| 26030 | − const elixirMatchers = __nccwpck_require__.ab + "elixir-matchers.json" | |
| 26031 | − core.info(`##[add-matcher]${elixirMatchers}`) | |
| 26032 | − } | |
| 26033 | −} | |
| 26071 | + if (agent) { | |
| 26072 | + throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') | |
| 26073 | + } | |
| 26034 | 26074 | |
| 26035 | −async function mix(shouldMix, what) { | |
| 26036 | − if (shouldMix === 'true') { | |
| 26037 | − const cmd = 'mix' | |
| 26038 | − const args = [`local.${what}`, '--force'] | |
| 26039 | − core.startGroup(`Running ${cmd} ${args}`) | |
| 26040 | − await doWithMirrors({ | |
| 26041 | − hexMirrors: hexMirrorsInput(), | |
| 26042 | − actionTitle: `mix ${what}`, | |
| 26043 | − action: async (hexMirror) => { | |
| 26044 | − process.env.HEX_MIRROR = hexMirror | |
| 26045 | − await exec(cmd, args) | |
| 26046 | − }, | |
| 26047 | − }) | |
| 26048 | − core.endGroup() | |
| 26075 | + return fn.call(dispatcher, { | |
| 26076 | + ...opts, | |
| 26077 | + origin: url.origin, | |
| 26078 | + path: url.search ? `${url.pathname}${url.search}` : url.pathname, | |
| 26079 | + method: opts.method || (opts.body ? 'PUT' : 'GET') | |
| 26080 | + }, handler) | |
| 26049 | 26081 | } |
| 26050 | 26082 | } |
| 26051 | 26083 | |
| 26052 | −async function maybeInstallGleam(gleamSpec) { | |
| 26053 | − let installed = false | |
| 26054 | − if (gleamSpec) { | |
| 26055 | − const gleamVersion = await getGleamVersion(gleamSpec) | |
| 26056 | − core.startGroup(`Installing Gleam ${gleamVersion}`) | |
| 26057 | − await install('gleam', { toolVersion: gleamVersion }) | |
| 26058 | − core.setOutput('gleam-version', gleamVersion) | |
| 26059 | − core.endGroup() | |
| 26084 | +module.exports.setGlobalDispatcher = setGlobalDispatcher | |
| 26085 | +module.exports.getGlobalDispatcher = getGlobalDispatcher | |
| 26060 | 26086 | |
| 26061 | − installed = true | |
| 26087 | +if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { | |
| 26088 | + let fetchImpl = null | |
| 26089 | + module.exports.fetch = async function fetch (resource) { | |
| 26090 | + if (!fetchImpl) { | |
| 26091 | + fetchImpl = (__nccwpck_require__(2315).fetch) | |
| 26092 | + } | |
| 26093 | + | |
| 26094 | + try { | |
| 26095 | + return await fetchImpl(...arguments) | |
| 26096 | + } catch (err) { | |
| 26097 | + if (typeof err === 'object') { | |
| 26098 | + Error.captureStackTrace(err, this) | |
| 26099 | + } | |
| 26100 | + | |
| 26101 | + throw err | |
| 26102 | + } | |
| 26062 | 26103 | } |
| 26104 | + module.exports.Headers = __nccwpck_require__(6349).Headers | |
| 26105 | + module.exports.Response = __nccwpck_require__(8676).Response | |
| 26106 | + module.exports.Request = __nccwpck_require__(5194).Request | |
| 26107 | + module.exports.FormData = __nccwpck_require__(3073).FormData | |
| 26108 | + module.exports.File = __nccwpck_require__(3041).File | |
| 26109 | + module.exports.FileReader = __nccwpck_require__(2160).FileReader | |
| 26063 | 26110 | |
| 26064 | − return installed | |
| 26111 | + const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5628) | |
| 26112 | + | |
| 26113 | + module.exports.setGlobalOrigin = setGlobalOrigin | |
| 26114 | + module.exports.getGlobalOrigin = getGlobalOrigin | |
| 26115 | + | |
| 26116 | + const { CacheStorage } = __nccwpck_require__(4738) | |
| 26117 | + const { kConstruct } = __nccwpck_require__(296) | |
| 26118 | + | |
| 26119 | + // Cache & CacheStorage are tightly coupled with fetch. Even if it may run | |
| 26120 | + // in an older version of Node, it doesn't have any use without fetch. | |
| 26121 | + module.exports.caches = new CacheStorage(kConstruct) | |
| 26065 | 26122 | } |
| 26066 | 26123 | |
| 26067 | −async function maybeInstallRebar3(rebar3Spec) { | |
| 26068 | − let installed = false | |
| 26069 | − let rebar3Version | |
| 26070 | − if (rebar3Spec) { | |
| 26071 | − if (rebar3Spec === 'nightly') { | |
| 26072 | − rebar3Version = 'nightly' | |
| 26073 | − } else { | |
| 26074 | − rebar3Version = await getRebar3Version(rebar3Spec) | |
| 26075 | − } | |
| 26076 | − core.startGroup(`Installing rebar3 ${rebar3Version}`) | |
| 26077 | − await install('rebar3', { toolVersion: rebar3Version }) | |
| 26078 | − core.setOutput('rebar3-version', rebar3Version) | |
| 26079 | − core.endGroup() | |
| 26124 | +if (util.nodeMajor >= 16) { | |
| 26125 | + const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(3168) | |
| 26080 | 26126 | |
| 26081 | − installed = true | |
| 26082 | − } | |
| 26127 | + module.exports.deleteCookie = deleteCookie | |
| 26128 | + module.exports.getCookies = getCookies | |
| 26129 | + module.exports.getSetCookies = getSetCookies | |
| 26130 | + module.exports.setCookie = setCookie | |
| 26083 | 26131 | |
| 26084 | − return installed | |
| 26132 | + const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) | |
| 26133 | + | |
| 26134 | + module.exports.parseMIMEType = parseMIMEType | |
| 26135 | + module.exports.serializeAMimeType = serializeAMimeType | |
| 26085 | 26136 | } |
| 26086 | 26137 | |
| 26087 | −function maybeRemoveOTPPrefix(otpSpec) { | |
| 26088 | − return otpSpec.replace(/^OTP-/, '') | |
| 26138 | +if (util.nodeMajor >= 18 && hasCrypto) { | |
| 26139 | + const { WebSocket } = __nccwpck_require__(5171) | |
| 26140 | + | |
| 26141 | + module.exports.WebSocket = WebSocket | |
| 26089 | 26142 | } |
| 26090 | 26143 | |
| 26091 | −async function getOTPVersion(otpSpec0, osVersion) { | |
| 26092 | − const [otpVersions, originListing, hexMirrors] = | |
| 26093 | − await getOTPVersions(osVersion) | |
| 26094 | − let spec = maybeRemoveOTPPrefix(otpSpec0) | |
| 26095 | − const versions = otpVersions | |
| 26096 | − const otpVersion = getVersionFromSpec(spec, versions) | |
| 26144 | +module.exports.request = makeDispatcher(api.request) | |
| 26145 | +module.exports.stream = makeDispatcher(api.stream) | |
| 26146 | +module.exports.pipeline = makeDispatcher(api.pipeline) | |
| 26147 | +module.exports.connect = makeDispatcher(api.connect) | |
| 26148 | +module.exports.upgrade = makeDispatcher(api.upgrade) | |
| 26097 | 26149 | |
| 26098 | − if (otpVersion === null) { | |
| 26099 | − throw new Error( | |
| 26100 | − requestedVersionFor('Erlang/OTP', otpSpec0, originListing, hexMirrors), | |
| 26101 | − ) | |
| 26102 | − } | |
| 26150 | +module.exports.MockClient = MockClient | |
| 26151 | +module.exports.MockPool = MockPool | |
| 26152 | +module.exports.MockAgent = MockAgent | |
| 26153 | +module.exports.mockErrors = mockErrors | |
| 26103 | 26154 | |
| 26104 | − return otpVersion // from the reference, for download | |
| 26105 | −} | |
| 26106 | 26155 | |
| 26107 | −function requestedVersionFor(tool, version, originListing, mirrors) { | |
| 26108 | − const isStrictVersion = isStrictVersion() | |
| 26156 | +/***/ }), | |
| 26109 | 26157 | |
| 26110 | − let versionType = 'loose' | |
| 26111 | − if (isStrictVersion) { | |
| 26112 | − versionType = 'strict' | |
| 26113 | − } | |
| 26158 | +/***/ 9965: | |
| 26159 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26114 | 26160 | |
| 26115 | − let ret = | |
| 26116 | − `Requested ${versionType} ${tool} version (${version}) not found in version list, ` + | |
| 26117 | − `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.` | |
| 26118 | − if (!isStrictVersion) { | |
| 26119 | − ret = `${ret} Should you be using option 'version-type': 'strict'?` | |
| 26120 | − } | |
| 26161 | +"use strict"; | |
| 26121 | 26162 | |
| 26122 | − return ret | |
| 26163 | + | |
| 26164 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 26165 | +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443) | |
| 26166 | +const DispatcherBase = __nccwpck_require__(1) | |
| 26167 | +const Pool = __nccwpck_require__(5076) | |
| 26168 | +const Client = __nccwpck_require__(6197) | |
| 26169 | +const util = __nccwpck_require__(3440) | |
| 26170 | +const createRedirectInterceptor = __nccwpck_require__(4415) | |
| 26171 | +const { WeakRef, FinalizationRegistry } = __nccwpck_require__(3194)() | |
| 26172 | + | |
| 26173 | +const kOnConnect = Symbol('onConnect') | |
| 26174 | +const kOnDisconnect = Symbol('onDisconnect') | |
| 26175 | +const kOnConnectionError = Symbol('onConnectionError') | |
| 26176 | +const kMaxRedirections = Symbol('maxRedirections') | |
| 26177 | +const kOnDrain = Symbol('onDrain') | |
| 26178 | +const kFactory = Symbol('factory') | |
| 26179 | +const kFinalizer = Symbol('finalizer') | |
| 26180 | +const kOptions = Symbol('options') | |
| 26181 | + | |
| 26182 | +function defaultFactory (origin, opts) { | |
| 26183 | + return opts && opts.connections === 1 | |
| 26184 | + ? new Client(origin, opts) | |
| 26185 | + : new Pool(origin, opts) | |
| 26123 | 26186 | } |
| 26124 | 26187 | |
| 26125 | −const knownBranches = ['main', 'master', 'maint'] | |
| 26126 | −const nonSpecificVersions = ['nightly', 'latest'] | |
| 26188 | +class Agent extends DispatcherBase { | |
| 26189 | + constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { | |
| 26190 | + super() | |
| 26127 | 26191 | |
| 26128 | −async function getElixirVersion(exSpec0) { | |
| 26129 | − const otpSuffix = /-otp-(\d+)/ | |
| 26130 | − const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null | |
| 26131 | − let otpVersionMajor = '' | |
| 26192 | + if (typeof factory !== 'function') { | |
| 26193 | + throw new InvalidArgumentError('factory must be a function.') | |
| 26194 | + } | |
| 26132 | 26195 | |
| 26133 | − if (userSuppliedOtp && isVersion(userSuppliedOtp)) { | |
| 26134 | − otpVersionMajor = userSuppliedOtp | |
| 26135 | − } else { | |
| 26136 | − let cmd = 'erl' | |
| 26137 | − if (process.platform === 'win32') { | |
| 26138 | − cmd = 'erl.exe' | |
| 26196 | + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { | |
| 26197 | + throw new InvalidArgumentError('connect must be a function or an object') | |
| 26139 | 26198 | } |
| 26140 | − const args = [ | |
| 26141 | − '-noshell', | |
| 26142 | − '-eval', | |
| 26143 | − 'io:format(erlang:system_info(otp_release)), halt().', | |
| 26144 | − ] | |
| 26145 | − await exec(cmd, args, { | |
| 26146 | − listeners: { | |
| 26147 | − stdout: (data) => { | |
| 26148 | − otpVersionMajor = data.toString() | |
| 26149 | − }, | |
| 26150 | − }, | |
| 26199 | + | |
| 26200 | + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { | |
| 26201 | + throw new InvalidArgumentError('maxRedirections must be a positive number') | |
| 26202 | + } | |
| 26203 | + | |
| 26204 | + if (connect && typeof connect !== 'function') { | |
| 26205 | + connect = { ...connect } | |
| 26206 | + } | |
| 26207 | + | |
| 26208 | + this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) | |
| 26209 | + ? options.interceptors.Agent | |
| 26210 | + : [createRedirectInterceptor({ maxRedirections })] | |
| 26211 | + | |
| 26212 | + this[kOptions] = { ...util.deepClone(options), connect } | |
| 26213 | + this[kOptions].interceptors = options.interceptors | |
| 26214 | + ? { ...options.interceptors } | |
| 26215 | + : undefined | |
| 26216 | + this[kMaxRedirections] = maxRedirections | |
| 26217 | + this[kFactory] = factory | |
| 26218 | + this[kClients] = new Map() | |
| 26219 | + this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { | |
| 26220 | + const ref = this[kClients].get(key) | |
| 26221 | + if (ref !== undefined && ref.deref() === undefined) { | |
| 26222 | + this[kClients].delete(key) | |
| 26223 | + } | |
| 26151 | 26224 | }) |
| 26152 | − } | |
| 26153 | 26225 | |
| 26154 | − const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] = | |
| 26155 | − await getElixirVersions() | |
| 26156 | − const spec = exSpec0.replace(otpSuffix, '') | |
| 26157 | − const versions = elixirVersions | |
| 26158 | − const elixirVersionFromSpec = getVersionFromSpec(spec, versions) | |
| 26226 | + const agent = this | |
| 26159 | 26227 | |
| 26160 | − if (elixirVersionFromSpec === null) { | |
| 26161 | − throw new Error( | |
| 26162 | − requestedVersionFor('Elixir', exSpec0, originListing, hexMirrors), | |
| 26163 | − ) | |
| 26228 | + this[kOnDrain] = (origin, targets) => { | |
| 26229 | + agent.emit('drain', origin, [agent, ...targets]) | |
| 26230 | + } | |
| 26231 | + | |
| 26232 | + this[kOnConnect] = (origin, targets) => { | |
| 26233 | + agent.emit('connect', origin, [agent, ...targets]) | |
| 26234 | + } | |
| 26235 | + | |
| 26236 | + this[kOnDisconnect] = (origin, targets, err) => { | |
| 26237 | + agent.emit('disconnect', origin, [agent, ...targets], err) | |
| 26238 | + } | |
| 26239 | + | |
| 26240 | + this[kOnConnectionError] = (origin, targets, err) => { | |
| 26241 | + agent.emit('connectionError', origin, [agent, ...targets], err) | |
| 26242 | + } | |
| 26164 | 26243 | } |
| 26165 | 26244 | |
| 26166 | − let foundCombo = false | |
| 26167 | − let otpVersionMajorIter = parseInt(otpVersionMajor) | |
| 26168 | − let otpVersionsMajor = [] | |
| 26169 | − while (otpVersionMajorIter > otpVersionMajor - 3) { | |
| 26170 | − otpVersionMajorIter += '' | |
| 26171 | − otpVersionsMajor.push(otpVersionMajorIter) | |
| 26172 | − const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec] | |
| 26173 | − if ( | |
| 26174 | − (elixirVersionComp && elixirVersionComp.includes(otpVersionMajorIter)) || | |
| 26175 | − !isVersion(otpVersionMajorIter) | |
| 26176 | − ) { | |
| 26177 | − core.info( | |
| 26178 | − `Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajorIter})`, | |
| 26179 | − ) | |
| 26180 | − foundCombo = true | |
| 26181 | − break | |
| 26245 | + get [kRunning] () { | |
| 26246 | + let ret = 0 | |
| 26247 | + for (const ref of this[kClients].values()) { | |
| 26248 | + const client = ref.deref() | |
| 26249 | + /* istanbul ignore next: gc is undeterministic */ | |
| 26250 | + if (client) { | |
| 26251 | + ret += client[kRunning] | |
| 26252 | + } | |
| 26182 | 26253 | } |
| 26183 | − otpVersionMajorIter = parseInt(otpVersionMajorIter) - 1 | |
| 26254 | + return ret | |
| 26184 | 26255 | } |
| 26185 | 26256 | |
| 26186 | − if (!foundCombo) { | |
| 26187 | − throw new Error( | |
| 26188 | − `Requested Elixir / Erlang/OTP version (${exSpec0} / tried ${otpVersionsMajor}) not ` + | |
| 26189 | − 'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' + | |
| 26190 | − 'Elixir and Erlang/OTP compatibility can be found at: ' + | |
| 26191 | − 'https://hexdocs.pm/elixir/compatibility-and-deprecations.html', | |
| 26192 | − ) | |
| 26257 | + [kDispatch] (opts, handler) { | |
| 26258 | + let key | |
| 26259 | + if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { | |
| 26260 | + key = String(opts.origin) | |
| 26261 | + } else { | |
| 26262 | + throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') | |
| 26263 | + } | |
| 26264 | + | |
| 26265 | + const ref = this[kClients].get(key) | |
| 26266 | + | |
| 26267 | + let dispatcher = ref ? ref.deref() : null | |
| 26268 | + if (!dispatcher) { | |
| 26269 | + dispatcher = this[kFactory](opts.origin, this[kOptions]) | |
| 26270 | + .on('drain', this[kOnDrain]) | |
| 26271 | + .on('connect', this[kOnConnect]) | |
| 26272 | + .on('disconnect', this[kOnDisconnect]) | |
| 26273 | + .on('connectionError', this[kOnConnectionError]) | |
| 26274 | + | |
| 26275 | + this[kClients].set(key, new WeakRef(dispatcher)) | |
| 26276 | + this[kFinalizer].register(dispatcher, key) | |
| 26277 | + } | |
| 26278 | + | |
| 26279 | + return dispatcher.dispatch(opts, handler) | |
| 26193 | 26280 | } |
| 26194 | 26281 | |
| 26195 | − let elixirVersionForDownload = elixirVersionFromSpec | |
| 26282 | + async [kClose] () { | |
| 26283 | + const closePromises = [] | |
| 26284 | + for (const ref of this[kClients].values()) { | |
| 26285 | + const client = ref.deref() | |
| 26286 | + /* istanbul ignore else: gc is undeterministic */ | |
| 26287 | + if (client) { | |
| 26288 | + closePromises.push(client.close()) | |
| 26289 | + } | |
| 26290 | + } | |
| 26196 | 26291 | |
| 26197 | − if (isVersion(otpVersionMajorIter)) { | |
| 26198 | − elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajorIter}` | |
| 26292 | + await Promise.all(closePromises) | |
| 26199 | 26293 | } |
| 26200 | 26294 | |
| 26201 | − return maybePrependWithV(elixirVersionForDownload) | |
| 26295 | + async [kDestroy] (err) { | |
| 26296 | + const destroyPromises = [] | |
| 26297 | + for (const ref of this[kClients].values()) { | |
| 26298 | + const client = ref.deref() | |
| 26299 | + /* istanbul ignore else: gc is undeterministic */ | |
| 26300 | + if (client) { | |
| 26301 | + destroyPromises.push(client.destroy(err)) | |
| 26302 | + } | |
| 26303 | + } | |
| 26304 | + | |
| 26305 | + await Promise.all(destroyPromises) | |
| 26306 | + } | |
| 26202 | 26307 | } |
| 26203 | 26308 | |
| 26204 | −async function getGleamVersion(gleamSpec0) { | |
| 26205 | − const [gleamVersions, originListing] = await getGleamVersions() | |
| 26206 | − const spec = gleamSpec0 | |
| 26207 | − const versions = gleamVersions | |
| 26208 | − const gleamVersion = getVersionFromSpec(spec, versions) | |
| 26309 | +module.exports = Agent | |
| 26209 | 26310 | |
| 26210 | − if (gleamVersion === null) { | |
| 26211 | − throw new Error(requestedVersionFor('Gleam', gleamSpec0, originListing)) | |
| 26212 | − } | |
| 26213 | 26311 | |
| 26214 | − return maybePrependWithV(gleamVersion) | |
| 26215 | −} | |
| 26312 | +/***/ }), | |
| 26216 | 26313 | |
| 26217 | −async function getRebar3Version(r3Spec) { | |
| 26218 | − const [rebar3Versions, originListing] = await getRebar3Versions() | |
| 26219 | − const spec = r3Spec | |
| 26220 | − const versions = rebar3Versions | |
| 26221 | − const rebar3Version = getVersionFromSpec(spec, versions) | |
| 26314 | +/***/ 158: | |
| 26315 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26222 | 26316 | |
| 26223 | − if (rebar3Version === null) { | |
| 26224 | − throw new Error(requestedVersionFor('rebar3', r3Spec, originListing)) | |
| 26225 | − } | |
| 26317 | +const { addAbortListener } = __nccwpck_require__(3440) | |
| 26318 | +const { RequestAbortedError } = __nccwpck_require__(8707) | |
| 26226 | 26319 | |
| 26227 | − return rebar3Version | |
| 26228 | −} | |
| 26320 | +const kListener = Symbol('kListener') | |
| 26321 | +const kSignal = Symbol('kSignal') | |
| 26229 | 26322 | |
| 26230 | −function otpArchitecture() { | |
| 26231 | − return getInput('otp-architecture', false) | |
| 26323 | +function abort (self) { | |
| 26324 | + if (self.abort) { | |
| 26325 | + self.abort() | |
| 26326 | + } else { | |
| 26327 | + self.onError(new RequestAbortedError()) | |
| 26328 | + } | |
| 26232 | 26329 | } |
| 26233 | 26330 | |
| 26234 | −async function getOTPVersions(osVersion) { | |
| 26235 | − let otpVersionsListings | |
| 26236 | − let originListing | |
| 26237 | − let hexMirrors = null | |
| 26238 | − if (process.platform === 'linux') { | |
| 26239 | − originListing = `/builds/otp/${getRunnerOSArchitecture()}/${osVersion}/builds.txt` | |
| 26240 | − hexMirrors = hexMirrorsInput() | |
| 26241 | − otpVersionsListings = await doWithMirrors({ | |
| 26242 | − hexMirrors, | |
| 26243 | − actionTitle: `fetch ${originListing}`, | |
| 26244 | − action: async (hexMirror) => { | |
| 26245 | − return get(`${hexMirror}${originListing}`) | |
| 26246 | − }, | |
| 26247 | − }) | |
| 26248 | − } else if (process.platform === 'win32') { | |
| 26249 | − originListing = | |
| 26250 | − 'https://api.github.com/repos/erlang/otp/releases?per_page=100' | |
| 26251 | − otpVersionsListings = await get(originListing, [1, 2, 3]) | |
| 26252 | − } else if (process.platform === 'darwin') { | |
| 26253 | − const arch = getRunnerOSArchitecture() | |
| 26254 | − let targetArch | |
| 26255 | − switch (arch) { | |
| 26256 | − case 'amd64': | |
| 26257 | − targetArch = 'x86_64' | |
| 26258 | − break | |
| 26259 | − case 'arm64': | |
| 26260 | − targetArch = 'aarch64' | |
| 26261 | − break | |
| 26262 | − } | |
| 26263 | − originListing = | |
| 26264 | − `https://raw.githubusercontent.com/erlef/otp_builds/refs/heads/main` + | |
| 26265 | − `/builds/${targetArch}-apple-darwin.csv` | |
| 26266 | − otpVersionsListings = await get(originListing) | |
| 26267 | − } | |
| 26331 | +function addSignal (self, signal) { | |
| 26332 | + self[kSignal] = null | |
| 26333 | + self[kListener] = null | |
| 26268 | 26334 | |
| 26269 | − debugLog( | |
| 26270 | − `OTP versions listings from ${originListing}, mirrors ${hexMirrors}`, | |
| 26271 | − otpVersionsListings, | |
| 26272 | − ) | |
| 26335 | + if (!signal) { | |
| 26336 | + return | |
| 26337 | + } | |
| 26273 | 26338 | |
| 26274 | − const otpVersions = {} | |
| 26275 | − if (process.platform === 'linux') { | |
| 26276 | − otpVersionsListings | |
| 26277 | − .trim() | |
| 26278 | − .split('\n') | |
| 26279 | − .forEach((line) => { | |
| 26280 | − const otpVersionOrig = line.match(/^([^ ]+)?( .+)/)[1] | |
| 26281 | − const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig) | |
| 26282 | − debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig]) | |
| 26283 | − otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference | |
| 26284 | − }) | |
| 26285 | − } else if (process.platform === 'win32') { | |
| 26286 | − const otpArch = otpArchitecture() | |
| 26287 | − const file_regex = new RegExp( | |
| 26288 | − `^otp_win${_.escapeRegExp(otpArch)}_(.*).exe$`, | |
| 26289 | − ) | |
| 26290 | − otpVersionsListings.forEach((otpVersionsListing) => { | |
| 26291 | − otpVersionsListing | |
| 26292 | − .map((x) => x.assets) | |
| 26293 | − .flat() | |
| 26294 | − .filter((x) => x.name.match(file_regex)) | |
| 26295 | − .forEach((x) => { | |
| 26296 | − const otpVersionOrig = x.name.match(file_regex)[1] | |
| 26297 | − const otpVersion = otpVersionOrig | |
| 26298 | − debugLog('OTP line and parsing', [x.name, otpVersion, otpVersionOrig]) | |
| 26299 | − otpVersions[otpVersion] = otpVersionOrig | |
| 26300 | − }) | |
| 26301 | − }) | |
| 26302 | − } else if (process.platform === 'darwin') { | |
| 26303 | − csv | |
| 26304 | − .parse(otpVersionsListings, { | |
| 26305 | − columns: true, | |
| 26306 | − }) | |
| 26307 | − .forEach((line) => { | |
| 26308 | − const otpVersionOrig = line.ref_name | |
| 26309 | − const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig) | |
| 26310 | − debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig]) | |
| 26311 | − otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference | |
| 26312 | − }) | |
| 26339 | + if (signal.aborted) { | |
| 26340 | + abort(self) | |
| 26341 | + return | |
| 26313 | 26342 | } |
| 26314 | 26343 | |
| 26315 | − debugLog( | |
| 26316 | − `OTP versions from ${originListing}, mirrors ${hexMirrors}`, | |
| 26317 | − JSON.stringify(otpVersions), | |
| 26318 | − ) | |
| 26344 | + self[kSignal] = signal | |
| 26345 | + self[kListener] = () => { | |
| 26346 | + abort(self) | |
| 26347 | + } | |
| 26319 | 26348 | |
| 26320 | − return [otpVersions, originListing, hexMirrors] | |
| 26349 | + addAbortListener(self[kSignal], self[kListener]) | |
| 26321 | 26350 | } |
| 26322 | 26351 | |
| 26323 | −async function getElixirVersions() { | |
| 26324 | − const originListing = '/builds/elixir/builds.txt' | |
| 26325 | − const hexMirrors = hexMirrorsInput() | |
| 26326 | − const elixirVersionsListings = await doWithMirrors({ | |
| 26327 | − hexMirrors, | |
| 26328 | − actionTitle: `fetch ${originListing}`, | |
| 26329 | − action: async (hexMirror) => { | |
| 26330 | − return get(`${hexMirror}${originListing}`) | |
| 26331 | − }, | |
| 26332 | − }) | |
| 26333 | − const otpVersionsForElixirMap = {} | |
| 26334 | − const elixirVersions = {} | |
| 26352 | +function removeSignal (self) { | |
| 26353 | + if (!self[kSignal]) { | |
| 26354 | + return | |
| 26355 | + } | |
| 26335 | 26356 | |
| 26336 | − elixirVersionsListings | |
| 26337 | − .trim() | |
| 26338 | − .split('\n') | |
| 26339 | − .forEach((line) => { | |
| 26340 | − const elixirMatch = | |
| 26341 | − line.match(/^v?(.+)-otp-([^ ]+)/) || line.match(/^v?([^ ]+)/) | |
| 26342 | − const elixirVersion = elixirMatch[1] | |
| 26343 | − const otpVersion = elixirMatch[2] | |
| 26344 | − const otpVersions = otpVersionsForElixirMap[elixirVersion] || [] | |
| 26345 | − if (otpVersion) { | |
| 26346 | − // -otp- present (special case) | |
| 26347 | − otpVersions.push(otpVersion) | |
| 26348 | − } | |
| 26349 | − otpVersionsForElixirMap[elixirVersion] = otpVersions | |
| 26350 | − elixirVersions[elixirVersion] = elixirVersion | |
| 26351 | − }) | |
| 26357 | + if ('removeEventListener' in self[kSignal]) { | |
| 26358 | + self[kSignal].removeEventListener('abort', self[kListener]) | |
| 26359 | + } else { | |
| 26360 | + self[kSignal].removeListener('abort', self[kListener]) | |
| 26361 | + } | |
| 26352 | 26362 | |
| 26353 | − return [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] | |
| 26363 | + self[kSignal] = null | |
| 26364 | + self[kListener] = null | |
| 26354 | 26365 | } |
| 26355 | 26366 | |
| 26356 | −async function getGleamVersions() { | |
| 26357 | − const originListing = | |
| 26358 | − 'https://api.github.com/repos/gleam-lang/gleam/releases?per_page=100' | |
| 26359 | − const resultJSONs = await get(originListing, [1, 2, 3]) | |
| 26360 | − const gleamVersionsListing = {} | |
| 26361 | − resultJSONs.forEach((resultJSON) => { | |
| 26362 | − resultJSON | |
| 26363 | − .map((x) => x.tag_name) | |
| 26364 | − .forEach((ver) => { | |
| 26365 | − const gleamMatch = ver.match(/^v?([^ ]+)/) | |
| 26366 | − const gleamVersion = gleamMatch[1] | |
| 26367 | − gleamVersionsListing[gleamVersion] = gleamVersion | |
| 26368 | − }) | |
| 26369 | − }) | |
| 26370 | − | |
| 26371 | − return [gleamVersionsListing, originListing] | |
| 26367 | +module.exports = { | |
| 26368 | + addSignal, | |
| 26369 | + removeSignal | |
| 26372 | 26370 | } |
| 26373 | 26371 | |
| 26374 | −async function getRebar3Versions() { | |
| 26375 | − const originListing = | |
| 26376 | − 'https://api.github.com/repos/erlang/rebar3/releases?per_page=100' | |
| 26377 | − const resultJSONs = await get(originListing, [1, 2, 3]) | |
| 26378 | − const rebar3VersionsListing = {} | |
| 26379 | − resultJSONs.forEach((resultJSON) => { | |
| 26380 | − resultJSON | |
| 26381 | − .map((x) => x.tag_name) | |
| 26382 | − .forEach((ver) => { | |
| 26383 | − rebar3VersionsListing[ver] = ver | |
| 26384 | − }) | |
| 26385 | − }) | |
| 26386 | 26372 | |
| 26387 | − return [rebar3VersionsListing, originListing] | |
| 26388 | −} | |
| 26373 | +/***/ }), | |
| 26389 | 26374 | |
| 26390 | −function isStrictVersion() { | |
| 26391 | − return getInput('version-type', false) === 'strict' | |
| 26392 | −} | |
| 26375 | +/***/ 4660: | |
| 26376 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26393 | 26377 | |
| 26394 | −function gt(left, right) { | |
| 26395 | − return semver.gt(parseVersion(left), parseVersion(right)) | |
| 26396 | −} | |
| 26378 | +"use strict"; | |
| 26397 | 26379 | |
| 26398 | −function validVersion(v) { | |
| 26399 | − return ( | |
| 26400 | − v.match( | |
| 26401 | − new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`), | |
| 26402 | − ) == null && | |
| 26403 | − // these ones are for rebar3, which has alpha and beta releases | |
| 26404 | − !v.startsWith('a') && | |
| 26405 | − !v.startsWith('b') | |
| 26406 | − ) | |
| 26407 | −} | |
| 26408 | 26380 | |
| 26409 | −function parseVersion(v) { | |
| 26410 | − v = v.includes('rc') ? v : v.split('.') | |
| 26411 | − if (v instanceof Array) { | |
| 26412 | − v = `${[v.shift(), v.shift(), v.shift()].join('.')}+${v.join('.')}` | |
| 26413 | − } | |
| 26414 | − return semver.coerce(v, { includePrerelease: true, loose: true }) | |
| 26415 | −} | |
| 26381 | +const { AsyncResource } = __nccwpck_require__(290) | |
| 26382 | +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) | |
| 26383 | +const util = __nccwpck_require__(3440) | |
| 26384 | +const { addSignal, removeSignal } = __nccwpck_require__(158) | |
| 26416 | 26385 | |
| 26417 | −function getVersionFromSpec(spec0, versions0) { | |
| 26418 | − let latest | |
| 26419 | − Object.keys(versions0).forEach((v) => { | |
| 26420 | − if (validVersion(v)) { | |
| 26421 | − latest = latest && gt(latest, v) ? latest : v | |
| 26386 | +class ConnectHandler extends AsyncResource { | |
| 26387 | + constructor (opts, callback) { | |
| 26388 | + if (!opts || typeof opts !== 'object') { | |
| 26389 | + throw new InvalidArgumentError('invalid opts') | |
| 26422 | 26390 | } |
| 26423 | − }) | |
| 26424 | − versions0.latest = latest | |
| 26425 | − const spec = maybeRemoveVPrefix(spec0) | |
| 26426 | 26391 | |
| 26427 | − const altVersions = {} | |
| 26428 | − Object.entries(versions0).forEach(([version, altVersion]) => { | |
| 26429 | − let coerced | |
| 26430 | − if ( | |
| 26431 | − isStrictVersion() || | |
| 26432 | − isRC(version) || | |
| 26433 | − isKnownBranch(version) || | |
| 26434 | − isKnownVerBranch(version) | |
| 26435 | − ) { | |
| 26436 | − // If `version-type: strict`, version is an RC, or version is "a branch" | |
| 26437 | − // we just try to remove a potential initial v | |
| 26438 | − coerced = maybeRemoveVPrefix(version) | |
| 26439 | − } else { | |
| 26440 | − // Otherwise, we place the version into a version bucket | |
| 26441 | − coerced = maybeCoerced(version) | |
| 26392 | + if (typeof callback !== 'function') { | |
| 26393 | + throw new InvalidArgumentError('invalid callback') | |
| 26442 | 26394 | } |
| 26443 | − const alt = (altVersions[coerced] || []).concat(altVersion) | |
| 26444 | − alt.sort(sortVersions) | |
| 26445 | − altVersions[coerced] = alt | |
| 26446 | − }) | |
| 26447 | 26395 | |
| 26448 | − let versions = Object.keys(altVersions) | |
| 26449 | − | |
| 26450 | − const rangeForMax = semver.validRange(spec0) || maybeCoerced(spec) | |
| 26451 | − const rangeMax = semver.maxSatisfying(versions, rangeForMax) | |
| 26452 | − let version = null | |
| 26396 | + const { signal, opaque, responseHeaders } = opts | |
| 26453 | 26397 | |
| 26454 | − if (spec0 === 'latest') { | |
| 26455 | − version = versions0[versions0.latest] | |
| 26456 | − } else if ( | |
| 26457 | − isStrictVersion() || | |
| 26458 | − isRC(spec0) || | |
| 26459 | − isKnownBranch(spec0) || | |
| 26460 | − isKnownVerBranch(spec0) || | |
| 26461 | − spec0 === 'nightly' | |
| 26462 | − ) { | |
| 26463 | − if (versions0[spec]) { | |
| 26464 | − // We obtain it directly | |
| 26465 | − version = versions0[spec] | |
| 26398 | + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { | |
| 26399 | + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') | |
| 26466 | 26400 | } |
| 26467 | − } else if (rangeMax !== null) { | |
| 26468 | − // Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest | |
| 26469 | − const thatVersion = spec | |
| 26470 | − const thatVersionAbc = versionAbc(thatVersion) | |
| 26471 | − const thatVersionAbcRange = semver.validRange(thatVersionAbc) | |
| 26472 | 26401 | |
| 26473 | − versions = altVersions[rangeMax] | |
| 26474 | − for (let i = versions.length - 1; i >= 0; i -= 1) { | |
| 26475 | − const thisVersion = versions[i] | |
| 26476 | − const thisVersionAbc = versionAbc(thisVersion) | |
| 26477 | − const thisVersionAbcRange = semver.validRange(thisVersionAbc) | |
| 26402 | + super('UNDICI_CONNECT') | |
| 26478 | 26403 | |
| 26479 | − if ( | |
| 26480 | − thatVersionAbcRange && | |
| 26481 | − semver.intersects(thatVersionAbcRange, thisVersionAbcRange) | |
| 26482 | − ) { | |
| 26483 | − version = thisVersion | |
| 26484 | − break | |
| 26485 | − } | |
| 26404 | + this.opaque = opaque || null | |
| 26405 | + this.responseHeaders = responseHeaders || null | |
| 26406 | + this.callback = callback | |
| 26407 | + this.abort = null | |
| 26408 | + | |
| 26409 | + addSignal(this, signal) | |
| 26410 | + } | |
| 26411 | + | |
| 26412 | + onConnect (abort, context) { | |
| 26413 | + if (!this.callback) { | |
| 26414 | + throw new RequestAbortedError() | |
| 26486 | 26415 | } |
| 26416 | + | |
| 26417 | + this.abort = abort | |
| 26418 | + this.context = context | |
| 26487 | 26419 | } |
| 26488 | 26420 | |
| 26489 | − return version || null | |
| 26490 | −} | |
| 26421 | + onHeaders () { | |
| 26422 | + throw new SocketError('bad connect', null) | |
| 26423 | + } | |
| 26491 | 26424 | |
| 26492 | −function maybeCoerced(v) { | |
| 26493 | − let ret = null | |
| 26494 | − try { | |
| 26495 | − if (!isRC(v)) { | |
| 26496 | − ret = semver.coerce(v).version | |
| 26497 | − } else { | |
| 26498 | − ret = maybeRemoveVPrefix(v) | |
| 26425 | + onUpgrade (statusCode, rawHeaders, socket) { | |
| 26426 | + const { callback, opaque, context } = this | |
| 26427 | + | |
| 26428 | + removeSignal(this) | |
| 26429 | + | |
| 26430 | + this.callback = null | |
| 26431 | + | |
| 26432 | + let headers = rawHeaders | |
| 26433 | + // Indicates is an HTTP2Session | |
| 26434 | + if (headers != null) { | |
| 26435 | + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 26499 | 26436 | } |
| 26500 | − } catch { | |
| 26501 | − // some stuff can't be coerced, like 'main' | |
| 26502 | − core.debug(`Was not able to coerce ${v} with semver`) | |
| 26503 | − ret = v | |
| 26437 | + | |
| 26438 | + this.runInAsyncScope(callback, null, null, { | |
| 26439 | + statusCode, | |
| 26440 | + headers, | |
| 26441 | + socket, | |
| 26442 | + opaque, | |
| 26443 | + context | |
| 26444 | + }) | |
| 26504 | 26445 | } |
| 26505 | 26446 | |
| 26506 | − return ret | |
| 26507 | −} | |
| 26447 | + onError (err) { | |
| 26448 | + const { callback, opaque } = this | |
| 26508 | 26449 | |
| 26509 | −function sortVersions(left, right) { | |
| 26510 | − let ret = 0 | |
| 26511 | − const newL = verAsComparableStr(left) | |
| 26512 | − const newR = verAsComparableStr(right) | |
| 26513 | − function verAsComparableStr(ver) { | |
| 26514 | − const matchGroups = 6 | |
| 26515 | − const verSpec = xyzAbcVersion('', '') | |
| 26516 | − const matches = ver.match(verSpec).splice(1, matchGroups) | |
| 26450 | + removeSignal(this) | |
| 26517 | 26451 | |
| 26518 | − return matches.reduce((acc, v) => acc + (v || '0').padStart(3, '0'), '') | |
| 26452 | + if (callback) { | |
| 26453 | + this.callback = null | |
| 26454 | + queueMicrotask(() => { | |
| 26455 | + this.runInAsyncScope(callback, null, err, { opaque }) | |
| 26456 | + }) | |
| 26457 | + } | |
| 26519 | 26458 | } |
| 26459 | +} | |
| 26520 | 26460 | |
| 26521 | − if (newL < newR) { | |
| 26522 | − ret = -1 | |
| 26523 | − } else if (newL > newR) { | |
| 26524 | − ret = 1 | |
| 26461 | +function connect (opts, callback) { | |
| 26462 | + if (callback === undefined) { | |
| 26463 | + return new Promise((resolve, reject) => { | |
| 26464 | + connect.call(this, opts, (err, data) => { | |
| 26465 | + return err ? reject(err) : resolve(data) | |
| 26466 | + }) | |
| 26467 | + }) | |
| 26525 | 26468 | } |
| 26526 | 26469 | |
| 26527 | − return ret | |
| 26470 | + try { | |
| 26471 | + const connectHandler = new ConnectHandler(opts, callback) | |
| 26472 | + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) | |
| 26473 | + } catch (err) { | |
| 26474 | + if (typeof callback !== 'function') { | |
| 26475 | + throw err | |
| 26476 | + } | |
| 26477 | + const opaque = opts && opts.opaque | |
| 26478 | + queueMicrotask(() => callback(err, { opaque })) | |
| 26479 | + } | |
| 26528 | 26480 | } |
| 26529 | 26481 | |
| 26530 | −function isRC(ver) { | |
| 26531 | − return ver.match(xyzAbcVersion('^', '(?:-rc\\.?\\d+)')) | |
| 26532 | −} | |
| 26482 | +module.exports = connect | |
| 26533 | 26483 | |
| 26534 | −function isKnownBranch(ver) { | |
| 26535 | − return knownBranches.includes(ver) | |
| 26536 | −} | |
| 26537 | 26484 | |
| 26538 | −function isKnownVerBranch(ver) { | |
| 26539 | − return knownBranches.some((b) => ver.match(b)) | |
| 26540 | −} | |
| 26485 | +/***/ }), | |
| 26541 | 26486 | |
| 26542 | −function githubARMRunnerArchs() { | |
| 26543 | − return ['ARM', 'ARM64'] | |
| 26544 | −} | |
| 26487 | +/***/ 6862: | |
| 26488 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26545 | 26489 | |
| 26546 | −function githubAMDRunnerArchs() { | |
| 26547 | − return ['X86', 'X64'] | |
| 26548 | −} | |
| 26490 | +"use strict"; | |
| 26549 | 26491 | |
| 26550 | −function getRunnerOSArchitecture() { | |
| 26551 | − // These options come from: | |
| 26552 | − // https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | |
| 26553 | − if (githubARMRunnerArchs().includes(process.env.RUNNER_ARCH)) { | |
| 26554 | − return 'arm64' | |
| 26492 | + | |
| 26493 | +const { | |
| 26494 | + Readable, | |
| 26495 | + Duplex, | |
| 26496 | + PassThrough | |
| 26497 | +} = __nccwpck_require__(2203) | |
| 26498 | +const { | |
| 26499 | + InvalidArgumentError, | |
| 26500 | + InvalidReturnValueError, | |
| 26501 | + RequestAbortedError | |
| 26502 | +} = __nccwpck_require__(8707) | |
| 26503 | +const util = __nccwpck_require__(3440) | |
| 26504 | +const { AsyncResource } = __nccwpck_require__(290) | |
| 26505 | +const { addSignal, removeSignal } = __nccwpck_require__(158) | |
| 26506 | +const assert = __nccwpck_require__(2613) | |
| 26507 | + | |
| 26508 | +const kResume = Symbol('resume') | |
| 26509 | + | |
| 26510 | +class PipelineRequest extends Readable { | |
| 26511 | + constructor () { | |
| 26512 | + super({ autoDestroy: true }) | |
| 26513 | + | |
| 26514 | + this[kResume] = null | |
| 26555 | 26515 | } |
| 26556 | 26516 | |
| 26557 | − if (githubAMDRunnerArchs().includes(process.env.RUNNER_ARCH)) { | |
| 26558 | − return 'amd64' | |
| 26517 | + _read () { | |
| 26518 | + const { [kResume]: resume } = this | |
| 26519 | + | |
| 26520 | + if (resume) { | |
| 26521 | + this[kResume] = null | |
| 26522 | + resume() | |
| 26523 | + } | |
| 26559 | 26524 | } |
| 26560 | 26525 | |
| 26561 | − throw new Error( | |
| 26562 | − 'Invalid Github runner architecture, expected one of ' + | |
| 26563 | − `${githubAMDRunnerArchs().concat(githubARMRunnerArchs()).join(', ')} ` + | |
| 26564 | − `but got process.env.RUNNER_ARCH = ${process.env.RUNNER_ARCH}`, | |
| 26565 | − ) | |
| 26526 | + _destroy (err, callback) { | |
| 26527 | + this._read() | |
| 26528 | + | |
| 26529 | + callback(err) | |
| 26530 | + } | |
| 26566 | 26531 | } |
| 26567 | 26532 | |
| 26568 | −function getRunnerOSVersion() { | |
| 26569 | − // List from https://github.com/actions/runner-images?tab=readme-ov-file#available-images | |
| 26570 | − const ImageOSToContainer = { | |
| 26571 | − ubuntu22: 'ubuntu-22.04', | |
| 26572 | − ubuntu24: 'ubuntu-24.04', | |
| 26573 | − win19: 'windows-2019', | |
| 26574 | − win22: 'windows-2022', | |
| 26575 | − win25: 'windows-2025', | |
| 26576 | − macos13: 'macOS-13', | |
| 26577 | − macos14: 'macOS-14', | |
| 26578 | − macos15: 'macOS-15', | |
| 26533 | +class PipelineResponse extends Readable { | |
| 26534 | + constructor (resume) { | |
| 26535 | + super({ autoDestroy: true }) | |
| 26536 | + this[kResume] = resume | |
| 26579 | 26537 | } |
| 26580 | − const deprecatedImageOSToContainer = { | |
| 26581 | − ubuntu18: 'ubuntu-18.04', | |
| 26582 | − ubuntu20: 'ubuntu-20.04', | |
| 26538 | + | |
| 26539 | + _read () { | |
| 26540 | + this[kResume]() | |
| 26583 | 26541 | } |
| 26584 | − const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS] | |
| 26585 | − if (!containerFromEnvImageOS) { | |
| 26586 | − const deprecatedContainerFromEnvImageOS = | |
| 26587 | − deprecatedImageOSToContainer[process.env.ImageOS] | |
| 26588 | − if (deprecatedContainerFromEnvImageOS) { | |
| 26589 | − core.warning( | |
| 26590 | − `You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` + | |
| 26591 | − 'Support for maintenance is very limited. Consider a non-deprecated version as ' + | |
| 26592 | − 'mentioned in the README.md.', | |
| 26593 | − ) | |
| 26594 | 26542 | |
| 26595 | − return deprecatedContainerFromEnvImageOS | |
| 26596 | − } else { | |
| 26597 | − throw new Error( | |
| 26598 | − "Tried to map a target OS from env. variable 'ImageOS' (got " + | |
| 26599 | − `${process.env.ImageOS}` + | |
| 26600 | − "), but failed. If you're using a " + | |
| 26601 | − "self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " + | |
| 26602 | − "['" + | |
| 26603 | − `${Object.keys(ImageOSToContainer).join("', '")}` + | |
| 26604 | − "']", | |
| 26605 | − ) | |
| 26543 | + _destroy (err, callback) { | |
| 26544 | + if (!err && !this._readableState.endEmitted) { | |
| 26545 | + err = new RequestAbortedError() | |
| 26606 | 26546 | } |
| 26607 | − } | |
| 26608 | 26547 | |
| 26609 | − return containerFromEnvImageOS | |
| 26548 | + callback(err) | |
| 26549 | + } | |
| 26610 | 26550 | } |
| 26611 | 26551 | |
| 26612 | −async function getUrlResponse(url, headers, attempt = 1) { | |
| 26613 | − try { | |
| 26614 | − const response = await fetch(url, { | |
| 26615 | − headers, | |
| 26616 | − signal: AbortSignal.timeout(10000), | |
| 26617 | − }) | |
| 26618 | − const contentType = response.headers.get('content-type') || '' | |
| 26552 | +class PipelineHandler extends AsyncResource { | |
| 26553 | + constructor (opts, handler) { | |
| 26554 | + if (!opts || typeof opts !== 'object') { | |
| 26555 | + throw new InvalidArgumentError('invalid opts') | |
| 26556 | + } | |
| 26619 | 26557 | |
| 26620 | − if (!response.ok) { | |
| 26621 | − throw new Error(response.statusText) | |
| 26558 | + if (typeof handler !== 'function') { | |
| 26559 | + throw new InvalidArgumentError('invalid handler') | |
| 26622 | 26560 | } |
| 26623 | 26561 | |
| 26624 | − if (contentType.indexOf('application/json') !== -1) { | |
| 26625 | − return response.json() | |
| 26626 | − } else { | |
| 26627 | − return response.text() | |
| 26562 | + const { signal, method, opaque, onInfo, responseHeaders } = opts | |
| 26563 | + | |
| 26564 | + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { | |
| 26565 | + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') | |
| 26628 | 26566 | } |
| 26629 | − } catch (err) { | |
| 26630 | − core.debug(`Error fetching from ${url}: ${err}`) | |
| 26631 | 26567 | |
| 26632 | − if (attempt <= MAX_HTTP_RETRIES) { | |
| 26633 | − const delay = attempt * 2 * 1000 | |
| 26634 | − core.debug(`Error during fetch. Retrying in ${delay}ms`) | |
| 26635 | − await new Promise((resolve) => setTimeout(resolve, delay)) | |
| 26636 | − return getUrlResponse(url, headers, attempt + 1) | |
| 26637 | − } else { | |
| 26638 | − throw err | |
| 26568 | + if (method === 'CONNECT') { | |
| 26569 | + throw new InvalidArgumentError('invalid method') | |
| 26639 | 26570 | } |
| 26640 | − } | |
| 26641 | −} | |
| 26642 | 26571 | |
| 26643 | −async function get(url0, pageIdxs) { | |
| 26644 | − const url = new URL(url0) | |
| 26645 | − const headers = {} | |
| 26646 | − const GithubToken = getInput('github-token', false) | |
| 26647 | − if (GithubToken && url.host === 'api.github.com') { | |
| 26648 | − headers.authorization = `Bearer ${GithubToken}` | |
| 26649 | − } | |
| 26572 | + if (onInfo && typeof onInfo !== 'function') { | |
| 26573 | + throw new InvalidArgumentError('invalid onInfo callback') | |
| 26574 | + } | |
| 26650 | 26575 | |
| 26651 | − if ((pageIdxs || []).length === 0) { | |
| 26652 | − return getUrlResponse(url, headers) | |
| 26653 | − } else { | |
| 26654 | − return Promise.all( | |
| 26655 | − pageIdxs.map((page) => { | |
| 26656 | − const urlWithPage = new URL(url) | |
| 26657 | − urlWithPage.searchParams.append('page', page) | |
| 26658 | − return getUrlResponse(urlWithPage, headers) | |
| 26659 | − }), | |
| 26660 | − ) | |
| 26661 | − } | |
| 26662 | −} | |
| 26576 | + super('UNDICI_PIPELINE') | |
| 26663 | 26577 | |
| 26664 | −function maybePrependWithV(v) { | |
| 26665 | − if (isVersion(v)) { | |
| 26666 | − return `v${v.replace('v', '')}` | |
| 26667 | − } | |
| 26578 | + this.opaque = opaque || null | |
| 26579 | + this.responseHeaders = responseHeaders || null | |
| 26580 | + this.handler = handler | |
| 26581 | + this.abort = null | |
| 26582 | + this.context = null | |
| 26583 | + this.onInfo = onInfo || null | |
| 26668 | 26584 | |
| 26669 | − return v | |
| 26670 | −} | |
| 26585 | + this.req = new PipelineRequest().on('error', util.nop) | |
| 26671 | 26586 | |
| 26672 | −function maybeRemoveVPrefix(ver) { | |
| 26673 | − let ret = ver | |
| 26674 | − if (isVersion(ver)) { | |
| 26675 | − ret = ver.replace('v', '') | |
| 26676 | − } | |
| 26587 | + this.ret = new Duplex({ | |
| 26588 | + readableObjectMode: opts.objectMode, | |
| 26589 | + autoDestroy: true, | |
| 26590 | + read: () => { | |
| 26591 | + const { body } = this | |
| 26677 | 26592 | |
| 26678 | − return ret | |
| 26679 | −} | |
| 26593 | + if (body && body.resume) { | |
| 26594 | + body.resume() | |
| 26595 | + } | |
| 26596 | + }, | |
| 26597 | + write: (chunk, encoding, callback) => { | |
| 26598 | + const { req } = this | |
| 26680 | 26599 | |
| 26681 | −function xyzAbcVersion(pref, suf) { | |
| 26682 | − // This accounts for stuff like 6.0.2.0.1.0, as proposed by Erlang's | |
| 26683 | − // https://www.erlang.org/doc/system_principles/versions.html | |
| 26684 | − const dd = '\\.?(\\d+)?' | |
| 26685 | − return new RegExp( | |
| 26686 | − `${pref}(?:OTP-)?v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`, | |
| 26687 | − ) | |
| 26688 | −} | |
| 26600 | + if (req.push(chunk, encoding) || req._readableState.destroyed) { | |
| 26601 | + callback() | |
| 26602 | + } else { | |
| 26603 | + req[kResume] = callback | |
| 26604 | + } | |
| 26605 | + }, | |
| 26606 | + destroy: (err, callback) => { | |
| 26607 | + const { body, req, res, ret, abort } = this | |
| 26689 | 26608 | |
| 26690 | −function versionAbc(ver) { | |
| 26691 | − // For a version like 6.0.2.0.1.0, return 0.1.0 | |
| 26692 | − return ver.match(/\d+(?:\.[^.]+)?(?:\.[^.]+)?(?:\.)?(.*)/)[1] | |
| 26693 | −} | |
| 26609 | + if (!err && !ret._readableState.endEmitted) { | |
| 26610 | + err = new RequestAbortedError() | |
| 26611 | + } | |
| 26694 | 26612 | |
| 26695 | −function isVersion(v) { | |
| 26696 | − return v.match(xyzAbcVersion('^', '$')) !== null | |
| 26697 | −} | |
| 26613 | + if (abort && err) { | |
| 26614 | + abort() | |
| 26615 | + } | |
| 26698 | 26616 | |
| 26699 | −function getInput(inputName, required, alternativeName, alternatives) { | |
| 26700 | − const alternativeValue = (alternatives || new Map()).get(alternativeName) | |
| 26701 | − let input = core.getInput(inputName, { | |
| 26702 | − required: alternativeValue ? false : required, | |
| 26703 | − }) | |
| 26704 | − // We can't have both input and alternativeValue set | |
| 26705 | − if (input && alternativeValue) { | |
| 26706 | − throw new Error( | |
| 26707 | − `Found input ${inputName}=${input} (from the YML) \ | |
| 26708 | −alongside ${alternativeName}=${alternativeValue} \ | |
| 26709 | −(from the version file). You must choose one or the other.`, | |
| 26710 | − ) | |
| 26711 | − } else if (!input) { | |
| 26712 | − input = alternativeValue | |
| 26617 | + util.destroy(body, err) | |
| 26618 | + util.destroy(req, err) | |
| 26619 | + util.destroy(res, err) | |
| 26620 | + | |
| 26621 | + removeSignal(this) | |
| 26622 | + | |
| 26623 | + callback(err) | |
| 26624 | + } | |
| 26625 | + }).on('prefinish', () => { | |
| 26626 | + const { req } = this | |
| 26627 | + | |
| 26628 | + // Node < 15 does not call _final in same tick. | |
| 26629 | + req.push(null) | |
| 26630 | + }) | |
| 26631 | + | |
| 26632 | + this.res = null | |
| 26633 | + | |
| 26634 | + addSignal(this, signal) | |
| 26713 | 26635 | } |
| 26714 | 26636 | |
| 26715 | − return input | |
| 26716 | −} | |
| 26637 | + onConnect (abort, context) { | |
| 26638 | + const { ret, res } = this | |
| 26717 | 26639 | |
| 26718 | −function parseVersionFile(versionFilePath0) { | |
| 26719 | − const versionFilePath = path.resolve( | |
| 26720 | − process.env.GITHUB_WORKSPACE, | |
| 26721 | − versionFilePath0, | |
| 26722 | − ) | |
| 26723 | − if (!fs.existsSync(versionFilePath)) { | |
| 26724 | − throw new Error( | |
| 26725 | − `The specified version file, ${versionFilePath0}, does not exist`, | |
| 26726 | − ) | |
| 26640 | + assert(!res, 'pipeline cannot be retried') | |
| 26641 | + | |
| 26642 | + if (ret.destroyed) { | |
| 26643 | + throw new RequestAbortedError() | |
| 26644 | + } | |
| 26645 | + | |
| 26646 | + this.abort = abort | |
| 26647 | + this.context = context | |
| 26727 | 26648 | } |
| 26728 | 26649 | |
| 26729 | − core.startGroup(`Parsing version file at ${versionFilePath0}`) | |
| 26730 | − const appVersions = new Map() | |
| 26731 | − const versions = fs.readFileSync(versionFilePath, 'utf8') | |
| 26732 | − // For the time being we parse .tool-versions | |
| 26733 | − // If we ever start parsing something else, this should | |
| 26734 | − // become default in a new option named e.g. version-file-type | |
| 26735 | − versions.split(/\r?\n/).forEach((line) => { | |
| 26736 | − const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/) | |
| 26737 | − if (appVersion) { | |
| 26738 | − const app = appVersion[1] | |
| 26739 | − if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) { | |
| 26740 | − const [, , , version] = appVersion | |
| 26741 | − core.info(`Consuming ${app} at version ${version}`) | |
| 26742 | − appVersions.set(app, version) | |
| 26650 | + onHeaders (statusCode, rawHeaders, resume) { | |
| 26651 | + const { opaque, handler, context } = this | |
| 26652 | + | |
| 26653 | + if (statusCode < 200) { | |
| 26654 | + if (this.onInfo) { | |
| 26655 | + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 26656 | + this.onInfo({ statusCode, headers }) | |
| 26743 | 26657 | } |
| 26658 | + return | |
| 26744 | 26659 | } |
| 26745 | − }) | |
| 26746 | − if (!appVersions.size) { | |
| 26747 | − core.info('There was apparently nothing to consume') | |
| 26748 | − } else { | |
| 26749 | − core.info('... done!') | |
| 26750 | − } | |
| 26751 | − core.endGroup() | |
| 26752 | 26660 | |
| 26753 | − return appVersions | |
| 26754 | −} | |
| 26661 | + this.res = new PipelineResponse(resume) | |
| 26755 | 26662 | |
| 26756 | −function debugLog(groupName, message) { | |
| 26757 | − const group = `Debugging for ${groupName}` | |
| 26758 | − core.debug( | |
| 26759 | − '┌──────────────────────────────────────────────────────────────────────────', | |
| 26760 | − ) | |
| 26761 | − core.debug(`│ ${group} - start`) | |
| 26762 | − core.debug(message) | |
| 26763 | − core.debug(`│ ${group} - stop`) | |
| 26764 | − core.debug( | |
| 26765 | − '└──────────────────────────────────────────────────────────────────────────', | |
| 26766 | − ) | |
| 26767 | −} | |
| 26663 | + let body | |
| 26664 | + try { | |
| 26665 | + this.handler = null | |
| 26666 | + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 26667 | + body = this.runInAsyncScope(handler, null, { | |
| 26668 | + statusCode, | |
| 26669 | + headers, | |
| 26670 | + opaque, | |
| 26671 | + body: this.res, | |
| 26672 | + context | |
| 26673 | + }) | |
| 26674 | + } catch (err) { | |
| 26675 | + this.res.on('error', util.nop) | |
| 26676 | + throw err | |
| 26677 | + } | |
| 26768 | 26678 | |
| 26769 | −function hexMirrorsInput() { | |
| 26770 | − return core.getMultilineInput('hexpm-mirrors', { | |
| 26771 | − required: false, | |
| 26772 | − }) | |
| 26773 | −} | |
| 26679 | + if (!body || typeof body.on !== 'function') { | |
| 26680 | + throw new InvalidReturnValueError('expected Readable') | |
| 26681 | + } | |
| 26774 | 26682 | |
| 26775 | −async function doWithMirrors(opts) { | |
| 26776 | − const { hexMirrors, actionTitle, action } = opts | |
| 26777 | − let actionRes | |
| 26683 | + body | |
| 26684 | + .on('data', (chunk) => { | |
| 26685 | + const { ret, body } = this | |
| 26778 | 26686 | |
| 26779 | − if (hexMirrors.length === 0) { | |
| 26780 | − throw new Error(`Could not ${actionTitle} from any hex.pm mirror`) | |
| 26687 | + if (!ret.push(chunk) && body.pause) { | |
| 26688 | + body.pause() | |
| 26689 | + } | |
| 26690 | + }) | |
| 26691 | + .on('error', (err) => { | |
| 26692 | + const { ret } = this | |
| 26693 | + | |
| 26694 | + util.destroy(ret, err) | |
| 26695 | + }) | |
| 26696 | + .on('end', () => { | |
| 26697 | + const { ret } = this | |
| 26698 | + | |
| 26699 | + ret.push(null) | |
| 26700 | + }) | |
| 26701 | + .on('close', () => { | |
| 26702 | + const { ret } = this | |
| 26703 | + | |
| 26704 | + if (!ret._readableState.ended) { | |
| 26705 | + util.destroy(ret, new RequestAbortedError()) | |
| 26706 | + } | |
| 26707 | + }) | |
| 26708 | + | |
| 26709 | + this.body = body | |
| 26781 | 26710 | } |
| 26782 | 26711 | |
| 26783 | − const [hexMirror, ...hexMirrorsT] = hexMirrors | |
| 26712 | + onData (chunk) { | |
| 26713 | + const { res } = this | |
| 26714 | + return res.push(chunk) | |
| 26715 | + } | |
| 26716 | + | |
| 26717 | + onComplete (trailers) { | |
| 26718 | + const { res } = this | |
| 26719 | + res.push(null) | |
| 26720 | + } | |
| 26721 | + | |
| 26722 | + onError (err) { | |
| 26723 | + const { ret } = this | |
| 26724 | + this.handler = null | |
| 26725 | + util.destroy(ret, err) | |
| 26726 | + } | |
| 26727 | +} | |
| 26728 | + | |
| 26729 | +function pipeline (opts, handler) { | |
| 26784 | 26730 | try { |
| 26785 | − actionRes = await action(hexMirror) | |
| 26731 | + const pipelineHandler = new PipelineHandler(opts, handler) | |
| 26732 | + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) | |
| 26733 | + return pipelineHandler.ret | |
| 26786 | 26734 | } catch (err) { |
| 26787 | − core.info( | |
| 26788 | − `Action ${actionTitle} failed for mirror ${hexMirror}, with ${err}`, | |
| 26789 | − ) | |
| 26790 | − core.debug(`Stacktrace: ${err.stack}`) | |
| 26791 | − actionRes = await doWithMirrors({ | |
| 26792 | − hexMirrors: hexMirrorsT, | |
| 26793 | − actionTitle, | |
| 26794 | − action, | |
| 26795 | − }) | |
| 26735 | + return new PassThrough().destroy(err) | |
| 26796 | 26736 | } |
| 26797 | − | |
| 26798 | − return actionRes | |
| 26799 | 26737 | } |
| 26800 | 26738 | |
| 26801 | −async function install(toolName, opts) { | |
| 26802 | − const { osVersion, toolVersion, hexMirror } = opts | |
| 26803 | − const versionSpec = | |
| 26804 | − osVersion !== undefined ? `${osVersion}/${toolVersion}` : toolVersion | |
| 26805 | − let installOpts | |
| 26739 | +module.exports = pipeline | |
| 26806 | 26740 | |
| 26807 | − // The installOpts object is composed of supported processPlatform keys | |
| 26808 | − // (e.g. 'linux', 'win32', or 'all' - in case there's no distinction between platforms) | |
| 26809 | − // In each of these keys there's an object with keys: | |
| 26810 | − // * downloadToolURL | |
| 26811 | − // - where to fetch the downloadable from | |
| 26812 | − // * extract | |
| 26813 | − // - if the downloadable is compressed: how to extract it | |
| 26814 | − // - return ['dir', targetDir] | |
| 26815 | − // - if the downloadable is not compressed: a filename.ext you want to cache it under | |
| 26816 | − // - return ['file', filenameWithExt] | |
| 26817 | − // * postExtract | |
| 26818 | − // - stuff to execute outside the cache scope (just after it's created) | |
| 26819 | − // * reportVersion | |
| 26820 | − /// - configuration elements on how to output the tool version, post-install | |
| 26821 | 26741 | |
| 26822 | − switch (toolName) { | |
| 26823 | − case 'otp': | |
| 26824 | − installOpts = { | |
| 26825 | − tool: 'Erlang/OTP', | |
| 26826 | − linux: { | |
| 26827 | − downloadToolURL: () => | |
| 26828 | − `${hexMirror}/builds/otp/${getRunnerOSArchitecture()}/${versionSpec}.tar.gz`, | |
| 26829 | − extract: async (file) => { | |
| 26830 | − const dest = undefined | |
| 26831 | − const flags = ['zx', '--strip-components=1'] | |
| 26832 | − const targetDir = await tc.extractTar(file, dest, flags) | |
| 26742 | +/***/ }), | |
| 26833 | 26743 | |
| 26834 | − return ['dir', targetDir] | |
| 26835 | − }, | |
| 26836 | − postExtract: async (cachePath) => { | |
| 26837 | − const cmd = path.join(cachePath, 'Install') | |
| 26838 | − const args = ['-minimal', cachePath] | |
| 26839 | − await exec(cmd, args) | |
| 26840 | − }, | |
| 26841 | − reportVersion: () => { | |
| 26842 | − const cmd = 'erl' | |
| 26843 | − const args = ['-version'] | |
| 26844 | − const env = {} | |
| 26744 | +/***/ 4043: | |
| 26745 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26845 | 26746 | |
| 26846 | − return [cmd, args, env] | |
| 26847 | − }, | |
| 26848 | − }, | |
| 26849 | − win32: { | |
| 26850 | − downloadToolURL: () => { | |
| 26851 | − const otpArch = otpArchitecture() | |
| 26852 | − return ( | |
| 26853 | − 'https://github.com/erlang/otp/releases/download/' + | |
| 26854 | − `OTP-${toolVersion}/otp_win${_.escapeRegExp(otpArch)}_${toolVersion}.exe` | |
| 26855 | − ) | |
| 26856 | − }, | |
| 26857 | − extract: async () => ['file', 'otp.exe'], | |
| 26858 | − postExtract: async (cachePath) => { | |
| 26859 | − const cmd = path.join(cachePath, 'otp.exe') | |
| 26860 | − const args = ['/S', `/D=${cachePath}`] | |
| 26861 | − await exec(cmd, args) | |
| 26862 | − }, | |
| 26863 | − reportVersion: () => { | |
| 26864 | − const cmd = 'erl.exe' | |
| 26865 | − const args = ['+V'] | |
| 26866 | − const env = {} | |
| 26747 | +"use strict"; | |
| 26867 | 26748 | |
| 26868 | − return [cmd, args, env] | |
| 26869 | − }, | |
| 26870 | − }, | |
| 26871 | − darwin: { | |
| 26872 | − downloadToolURL: (versionSpec) => { | |
| 26873 | − let suffix = '' | |
| 26874 | − if (isKnownVerBranch(versionSpec)) { | |
| 26875 | − // for these otp_builds adds `-latest` in the folder path | |
| 26876 | − suffix = '-latest' | |
| 26877 | − } | |
| 26878 | − return ( | |
| 26879 | − `https://github.com/erlef/otp_builds/releases/download/` + | |
| 26880 | − `${toolVersion}${suffix}/${toolVersion}-macos-${getRunnerOSArchitecture()}.tar.gz` | |
| 26881 | − ) | |
| 26882 | − }, | |
| 26883 | − extract: async (file) => { | |
| 26884 | − const dest = undefined | |
| 26885 | − const flags = ['zx'] | |
| 26886 | − const targetDir = await tc.extractTar(file, dest, flags) | |
| 26887 | 26749 | |
| 26888 | − return ['dir', targetDir] | |
| 26889 | − }, | |
| 26890 | − postExtract: async (/*cachePath*/) => { | |
| 26891 | − // nothing to do | |
| 26892 | − }, | |
| 26893 | − reportVersion: () => { | |
| 26894 | − const cmd = 'erl' | |
| 26895 | − const args = ['-version'] | |
| 26896 | − const env = {} | |
| 26750 | +const Readable = __nccwpck_require__(9927) | |
| 26751 | +const { | |
| 26752 | + InvalidArgumentError, | |
| 26753 | + RequestAbortedError | |
| 26754 | +} = __nccwpck_require__(8707) | |
| 26755 | +const util = __nccwpck_require__(3440) | |
| 26756 | +const { getResolveErrorBodyCallback } = __nccwpck_require__(7655) | |
| 26757 | +const { AsyncResource } = __nccwpck_require__(290) | |
| 26758 | +const { addSignal, removeSignal } = __nccwpck_require__(158) | |
| 26897 | 26759 | |
| 26898 | − return [cmd, args, env] | |
| 26899 | − }, | |
| 26900 | − }, | |
| 26760 | +class RequestHandler extends AsyncResource { | |
| 26761 | + constructor (opts, callback) { | |
| 26762 | + if (!opts || typeof opts !== 'object') { | |
| 26763 | + throw new InvalidArgumentError('invalid opts') | |
| 26764 | + } | |
| 26765 | + | |
| 26766 | + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts | |
| 26767 | + | |
| 26768 | + try { | |
| 26769 | + if (typeof callback !== 'function') { | |
| 26770 | + throw new InvalidArgumentError('invalid callback') | |
| 26901 | 26771 | } |
| 26902 | − break | |
| 26903 | − case 'elixir': | |
| 26904 | − installOpts = { | |
| 26905 | − tool: 'Elixir', | |
| 26906 | − all: { | |
| 26907 | − downloadToolURL: () => | |
| 26908 | − `${hexMirror}/builds/elixir/${versionSpec}.zip`, | |
| 26909 | − extract: async (file) => { | |
| 26910 | − const targetDir = await tc.extractZip(file) | |
| 26772 | + | |
| 26773 | + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { | |
| 26774 | + throw new InvalidArgumentError('invalid highWaterMark') | |
| 26775 | + } | |
| 26776 | + | |
| 26777 | + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { | |
| 26778 | + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') | |
| 26779 | + } | |
| 26780 | + | |
| 26781 | + if (method === 'CONNECT') { | |
| 26782 | + throw new InvalidArgumentError('invalid method') | |
| 26783 | + } | |
| 26784 | + | |
| 26785 | + if (onInfo && typeof onInfo !== 'function') { | |
| 26786 | + throw new InvalidArgumentError('invalid onInfo callback') | |
| 26787 | + } | |
| 26788 | + | |
| 26789 | + super('UNDICI_REQUEST') | |
| 26790 | + } catch (err) { | |
| 26791 | + if (util.isStream(body)) { | |
| 26792 | + util.destroy(body.on('error', util.nop), err) | |
| 26793 | + } | |
| 26794 | + throw err | |
| 26795 | + } | |
| 26796 | + | |
| 26797 | + this.responseHeaders = responseHeaders || null | |
| 26798 | + this.opaque = opaque || null | |
| 26799 | + this.callback = callback | |
| 26800 | + this.res = null | |
| 26801 | + this.abort = null | |
| 26802 | + this.body = body | |
| 26803 | + this.trailers = {} | |
| 26804 | + this.context = null | |
| 26805 | + this.onInfo = onInfo || null | |
| 26806 | + this.throwOnError = throwOnError | |
| 26807 | + this.highWaterMark = highWaterMark | |
| 26808 | + | |
| 26809 | + if (util.isStream(body)) { | |
| 26810 | + body.on('error', (err) => { | |
| 26811 | + this.onError(err) | |
| 26812 | + }) | |
| 26813 | + } | |
| 26814 | + | |
| 26815 | + addSignal(this, signal) | |
| 26816 | + } | |
| 26817 | + | |
| 26818 | + onConnect (abort, context) { | |
| 26819 | + if (!this.callback) { | |
| 26820 | + throw new RequestAbortedError() | |
| 26821 | + } | |
| 26822 | + | |
| 26823 | + this.abort = abort | |
| 26824 | + this.context = context | |
| 26825 | + } | |
| 26826 | + | |
| 26827 | + onHeaders (statusCode, rawHeaders, resume, statusMessage) { | |
| 26828 | + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this | |
| 26829 | + | |
| 26830 | + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 26831 | + | |
| 26832 | + if (statusCode < 200) { | |
| 26833 | + if (this.onInfo) { | |
| 26834 | + this.onInfo({ statusCode, headers }) | |
| 26835 | + } | |
| 26836 | + return | |
| 26837 | + } | |
| 26838 | + | |
| 26839 | + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers | |
| 26840 | + const contentType = parsedHeaders['content-type'] | |
| 26841 | + const body = new Readable({ resume, abort, contentType, highWaterMark }) | |
| 26842 | + | |
| 26843 | + this.callback = null | |
| 26844 | + this.res = body | |
| 26845 | + if (callback !== null) { | |
| 26846 | + if (this.throwOnError && statusCode >= 400) { | |
| 26847 | + this.runInAsyncScope(getResolveErrorBodyCallback, null, | |
| 26848 | + { callback, body, contentType, statusCode, statusMessage, headers } | |
| 26849 | + ) | |
| 26850 | + } else { | |
| 26851 | + this.runInAsyncScope(callback, null, null, { | |
| 26852 | + statusCode, | |
| 26853 | + headers, | |
| 26854 | + trailers: this.trailers, | |
| 26855 | + opaque, | |
| 26856 | + body, | |
| 26857 | + context | |
| 26858 | + }) | |
| 26859 | + } | |
| 26860 | + } | |
| 26861 | + } | |
| 26862 | + | |
| 26863 | + onData (chunk) { | |
| 26864 | + const { res } = this | |
| 26865 | + return res.push(chunk) | |
| 26866 | + } | |
| 26867 | + | |
| 26868 | + onComplete (trailers) { | |
| 26869 | + const { res } = this | |
| 26870 | + | |
| 26871 | + removeSignal(this) | |
| 26872 | + | |
| 26873 | + util.parseHeaders(trailers, this.trailers) | |
| 26874 | + | |
| 26875 | + res.push(null) | |
| 26876 | + } | |
| 26877 | + | |
| 26878 | + onError (err) { | |
| 26879 | + const { res, callback, body, opaque } = this | |
| 26880 | + | |
| 26881 | + removeSignal(this) | |
| 26882 | + | |
| 26883 | + if (callback) { | |
| 26884 | + // TODO: Does this need queueMicrotask? | |
| 26885 | + this.callback = null | |
| 26886 | + queueMicrotask(() => { | |
| 26887 | + this.runInAsyncScope(callback, null, err, { opaque }) | |
| 26888 | + }) | |
| 26889 | + } | |
| 26890 | + | |
| 26891 | + if (res) { | |
| 26892 | + this.res = null | |
| 26893 | + // Ensure all queued handlers are invoked before destroying res. | |
| 26894 | + queueMicrotask(() => { | |
| 26895 | + util.destroy(res, err) | |
| 26896 | + }) | |
| 26897 | + } | |
| 26898 | + | |
| 26899 | + if (body) { | |
| 26900 | + this.body = null | |
| 26901 | + util.destroy(body, err) | |
| 26902 | + } | |
| 26903 | + } | |
| 26904 | +} | |
| 26905 | + | |
| 26906 | +function request (opts, callback) { | |
| 26907 | + if (callback === undefined) { | |
| 26908 | + return new Promise((resolve, reject) => { | |
| 26909 | + request.call(this, opts, (err, data) => { | |
| 26910 | + return err ? reject(err) : resolve(data) | |
| 26911 | + }) | |
| 26912 | + }) | |
| 26913 | + } | |
| 26914 | + | |
| 26915 | + try { | |
| 26916 | + this.dispatch(opts, new RequestHandler(opts, callback)) | |
| 26917 | + } catch (err) { | |
| 26918 | + if (typeof callback !== 'function') { | |
| 26919 | + throw err | |
| 26920 | + } | |
| 26921 | + const opaque = opts && opts.opaque | |
| 26922 | + queueMicrotask(() => callback(err, { opaque })) | |
| 26923 | + } | |
| 26924 | +} | |
| 26925 | + | |
| 26926 | +module.exports = request | |
| 26927 | +module.exports.RequestHandler = RequestHandler | |
| 26928 | + | |
| 26929 | + | |
| 26930 | +/***/ }), | |
| 26931 | + | |
| 26932 | +/***/ 3560: | |
| 26933 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26934 | + | |
| 26935 | +"use strict"; | |
| 26936 | + | |
| 26937 | + | |
| 26938 | +const { finished, PassThrough } = __nccwpck_require__(2203) | |
| 26939 | +const { | |
| 26940 | + InvalidArgumentError, | |
| 26941 | + InvalidReturnValueError, | |
| 26942 | + RequestAbortedError | |
| 26943 | +} = __nccwpck_require__(8707) | |
| 26944 | +const util = __nccwpck_require__(3440) | |
| 26945 | +const { getResolveErrorBodyCallback } = __nccwpck_require__(7655) | |
| 26946 | +const { AsyncResource } = __nccwpck_require__(290) | |
| 26947 | +const { addSignal, removeSignal } = __nccwpck_require__(158) | |
| 26948 | + | |
| 26949 | +class StreamHandler extends AsyncResource { | |
| 26950 | + constructor (opts, factory, callback) { | |
| 26951 | + if (!opts || typeof opts !== 'object') { | |
| 26952 | + throw new InvalidArgumentError('invalid opts') | |
| 26953 | + } | |
| 26954 | + | |
| 26955 | + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts | |
| 26956 | + | |
| 26957 | + try { | |
| 26958 | + if (typeof callback !== 'function') { | |
| 26959 | + throw new InvalidArgumentError('invalid callback') | |
| 26960 | + } | |
| 26961 | + | |
| 26962 | + if (typeof factory !== 'function') { | |
| 26963 | + throw new InvalidArgumentError('invalid factory') | |
| 26964 | + } | |
| 26965 | + | |
| 26966 | + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { | |
| 26967 | + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') | |
| 26968 | + } | |
| 26969 | + | |
| 26970 | + if (method === 'CONNECT') { | |
| 26971 | + throw new InvalidArgumentError('invalid method') | |
| 26972 | + } | |
| 26973 | + | |
| 26974 | + if (onInfo && typeof onInfo !== 'function') { | |
| 26975 | + throw new InvalidArgumentError('invalid onInfo callback') | |
| 26976 | + } | |
| 26977 | + | |
| 26978 | + super('UNDICI_STREAM') | |
| 26979 | + } catch (err) { | |
| 26980 | + if (util.isStream(body)) { | |
| 26981 | + util.destroy(body.on('error', util.nop), err) | |
| 26982 | + } | |
| 26983 | + throw err | |
| 26984 | + } | |
| 26985 | + | |
| 26986 | + this.responseHeaders = responseHeaders || null | |
| 26987 | + this.opaque = opaque || null | |
| 26988 | + this.factory = factory | |
| 26989 | + this.callback = callback | |
| 26990 | + this.res = null | |
| 26991 | + this.abort = null | |
| 26992 | + this.context = null | |
| 26993 | + this.trailers = null | |
| 26994 | + this.body = body | |
| 26995 | + this.onInfo = onInfo || null | |
| 26996 | + this.throwOnError = throwOnError || false | |
| 26997 | + | |
| 26998 | + if (util.isStream(body)) { | |
| 26999 | + body.on('error', (err) => { | |
| 27000 | + this.onError(err) | |
| 27001 | + }) | |
| 27002 | + } | |
| 27003 | + | |
| 27004 | + addSignal(this, signal) | |
| 27005 | + } | |
| 27006 | + | |
| 27007 | + onConnect (abort, context) { | |
| 27008 | + if (!this.callback) { | |
| 27009 | + throw new RequestAbortedError() | |
| 27010 | + } | |
| 27011 | + | |
| 27012 | + this.abort = abort | |
| 27013 | + this.context = context | |
| 27014 | + } | |
| 27015 | + | |
| 27016 | + onHeaders (statusCode, rawHeaders, resume, statusMessage) { | |
| 27017 | + const { factory, opaque, context, callback, responseHeaders } = this | |
| 27018 | + | |
| 27019 | + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 27020 | + | |
| 27021 | + if (statusCode < 200) { | |
| 27022 | + if (this.onInfo) { | |
| 27023 | + this.onInfo({ statusCode, headers }) | |
| 27024 | + } | |
| 27025 | + return | |
| 27026 | + } | |
| 27027 | + | |
| 27028 | + this.factory = null | |
| 27029 | + | |
| 27030 | + let res | |
| 27031 | + | |
| 27032 | + if (this.throwOnError && statusCode >= 400) { | |
| 27033 | + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers | |
| 27034 | + const contentType = parsedHeaders['content-type'] | |
| 27035 | + res = new PassThrough() | |
| 27036 | + | |
| 27037 | + this.callback = null | |
| 27038 | + this.runInAsyncScope(getResolveErrorBodyCallback, null, | |
| 27039 | + { callback, body: res, contentType, statusCode, statusMessage, headers } | |
| 27040 | + ) | |
| 27041 | + } else { | |
| 27042 | + if (factory === null) { | |
| 27043 | + return | |
| 27044 | + } | |
| 27045 | + | |
| 27046 | + res = this.runInAsyncScope(factory, null, { | |
| 27047 | + statusCode, | |
| 27048 | + headers, | |
| 27049 | + opaque, | |
| 27050 | + context | |
| 27051 | + }) | |
| 27052 | + | |
| 27053 | + if ( | |
| 27054 | + !res || | |
| 27055 | + typeof res.write !== 'function' || | |
| 27056 | + typeof res.end !== 'function' || | |
| 27057 | + typeof res.on !== 'function' | |
| 27058 | + ) { | |
| 27059 | + throw new InvalidReturnValueError('expected Writable') | |
| 27060 | + } | |
| 27061 | + | |
| 27062 | + // TODO: Avoid finished. It registers an unnecessary amount of listeners. | |
| 27063 | + finished(res, { readable: false }, (err) => { | |
| 27064 | + const { callback, res, opaque, trailers, abort } = this | |
| 27065 | + | |
| 27066 | + this.res = null | |
| 27067 | + if (err || !res.readable) { | |
| 27068 | + util.destroy(res, err) | |
| 27069 | + } | |
| 27070 | + | |
| 27071 | + this.callback = null | |
| 27072 | + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) | |
| 27073 | + | |
| 27074 | + if (err) { | |
| 27075 | + abort() | |
| 27076 | + } | |
| 27077 | + }) | |
| 27078 | + } | |
| 27079 | + | |
| 27080 | + res.on('drain', resume) | |
| 27081 | + | |
| 27082 | + this.res = res | |
| 27083 | + | |
| 27084 | + const needDrain = res.writableNeedDrain !== undefined | |
| 27085 | + ? res.writableNeedDrain | |
| 27086 | + : res._writableState && res._writableState.needDrain | |
| 27087 | + | |
| 27088 | + return needDrain !== true | |
| 27089 | + } | |
| 27090 | + | |
| 27091 | + onData (chunk) { | |
| 27092 | + const { res } = this | |
| 27093 | + | |
| 27094 | + return res ? res.write(chunk) : true | |
| 27095 | + } | |
| 27096 | + | |
| 27097 | + onComplete (trailers) { | |
| 27098 | + const { res } = this | |
| 27099 | + | |
| 27100 | + removeSignal(this) | |
| 27101 | + | |
| 27102 | + if (!res) { | |
| 27103 | + return | |
| 27104 | + } | |
| 27105 | + | |
| 27106 | + this.trailers = util.parseHeaders(trailers) | |
| 27107 | + | |
| 27108 | + res.end() | |
| 27109 | + } | |
| 27110 | + | |
| 27111 | + onError (err) { | |
| 27112 | + const { res, callback, opaque, body } = this | |
| 27113 | + | |
| 27114 | + removeSignal(this) | |
| 27115 | + | |
| 27116 | + this.factory = null | |
| 27117 | + | |
| 27118 | + if (res) { | |
| 27119 | + this.res = null | |
| 27120 | + util.destroy(res, err) | |
| 27121 | + } else if (callback) { | |
| 27122 | + this.callback = null | |
| 27123 | + queueMicrotask(() => { | |
| 27124 | + this.runInAsyncScope(callback, null, err, { opaque }) | |
| 27125 | + }) | |
| 27126 | + } | |
| 27127 | + | |
| 27128 | + if (body) { | |
| 27129 | + this.body = null | |
| 27130 | + util.destroy(body, err) | |
| 27131 | + } | |
| 27132 | + } | |
| 27133 | +} | |
| 27134 | + | |
| 27135 | +function stream (opts, factory, callback) { | |
| 27136 | + if (callback === undefined) { | |
| 27137 | + return new Promise((resolve, reject) => { | |
| 27138 | + stream.call(this, opts, factory, (err, data) => { | |
| 27139 | + return err ? reject(err) : resolve(data) | |
| 27140 | + }) | |
| 27141 | + }) | |
| 27142 | + } | |
| 27143 | + | |
| 27144 | + try { | |
| 27145 | + this.dispatch(opts, new StreamHandler(opts, factory, callback)) | |
| 27146 | + } catch (err) { | |
| 27147 | + if (typeof callback !== 'function') { | |
| 27148 | + throw err | |
| 27149 | + } | |
| 27150 | + const opaque = opts && opts.opaque | |
| 27151 | + queueMicrotask(() => callback(err, { opaque })) | |
| 27152 | + } | |
| 27153 | +} | |
| 27154 | + | |
| 27155 | +module.exports = stream | |
| 27156 | + | |
| 27157 | + | |
| 27158 | +/***/ }), | |
| 27159 | + | |
| 27160 | +/***/ 1882: | |
| 27161 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27162 | + | |
| 27163 | +"use strict"; | |
| 27164 | + | |
| 27165 | + | |
| 27166 | +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) | |
| 27167 | +const { AsyncResource } = __nccwpck_require__(290) | |
| 27168 | +const util = __nccwpck_require__(3440) | |
| 27169 | +const { addSignal, removeSignal } = __nccwpck_require__(158) | |
| 27170 | +const assert = __nccwpck_require__(2613) | |
| 27171 | + | |
| 27172 | +class UpgradeHandler extends AsyncResource { | |
| 27173 | + constructor (opts, callback) { | |
| 27174 | + if (!opts || typeof opts !== 'object') { | |
| 27175 | + throw new InvalidArgumentError('invalid opts') | |
| 27176 | + } | |
| 27177 | + | |
| 27178 | + if (typeof callback !== 'function') { | |
| 27179 | + throw new InvalidArgumentError('invalid callback') | |
| 27180 | + } | |
| 27181 | + | |
| 27182 | + const { signal, opaque, responseHeaders } = opts | |
| 27183 | + | |
| 27184 | + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { | |
| 27185 | + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') | |
| 27186 | + } | |
| 27187 | + | |
| 27188 | + super('UNDICI_UPGRADE') | |
| 27189 | + | |
| 27190 | + this.responseHeaders = responseHeaders || null | |
| 27191 | + this.opaque = opaque || null | |
| 27192 | + this.callback = callback | |
| 27193 | + this.abort = null | |
| 27194 | + this.context = null | |
| 27195 | + | |
| 27196 | + addSignal(this, signal) | |
| 27197 | + } | |
| 27198 | + | |
| 27199 | + onConnect (abort, context) { | |
| 27200 | + if (!this.callback) { | |
| 27201 | + throw new RequestAbortedError() | |
| 27202 | + } | |
| 27203 | + | |
| 27204 | + this.abort = abort | |
| 27205 | + this.context = null | |
| 27206 | + } | |
| 27207 | + | |
| 27208 | + onHeaders () { | |
| 27209 | + throw new SocketError('bad upgrade', null) | |
| 27210 | + } | |
| 27211 | + | |
| 27212 | + onUpgrade (statusCode, rawHeaders, socket) { | |
| 27213 | + const { callback, opaque, context } = this | |
| 27214 | + | |
| 27215 | + assert.strictEqual(statusCode, 101) | |
| 27216 | + | |
| 27217 | + removeSignal(this) | |
| 27218 | + | |
| 27219 | + this.callback = null | |
| 27220 | + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) | |
| 27221 | + this.runInAsyncScope(callback, null, null, { | |
| 27222 | + headers, | |
| 27223 | + socket, | |
| 27224 | + opaque, | |
| 27225 | + context | |
| 27226 | + }) | |
| 27227 | + } | |
| 27228 | + | |
| 27229 | + onError (err) { | |
| 27230 | + const { callback, opaque } = this | |
| 27231 | + | |
| 27232 | + removeSignal(this) | |
| 27233 | + | |
| 27234 | + if (callback) { | |
| 27235 | + this.callback = null | |
| 27236 | + queueMicrotask(() => { | |
| 27237 | + this.runInAsyncScope(callback, null, err, { opaque }) | |
| 27238 | + }) | |
| 27239 | + } | |
| 27240 | + } | |
| 27241 | +} | |
| 27242 | + | |
| 27243 | +function upgrade (opts, callback) { | |
| 27244 | + if (callback === undefined) { | |
| 27245 | + return new Promise((resolve, reject) => { | |
| 27246 | + upgrade.call(this, opts, (err, data) => { | |
| 27247 | + return err ? reject(err) : resolve(data) | |
| 27248 | + }) | |
| 27249 | + }) | |
| 27250 | + } | |
| 27251 | + | |
| 27252 | + try { | |
| 27253 | + const upgradeHandler = new UpgradeHandler(opts, callback) | |
| 27254 | + this.dispatch({ | |
| 27255 | + ...opts, | |
| 27256 | + method: opts.method || 'GET', | |
| 27257 | + upgrade: opts.protocol || 'Websocket' | |
| 27258 | + }, upgradeHandler) | |
| 27259 | + } catch (err) { | |
| 27260 | + if (typeof callback !== 'function') { | |
| 27261 | + throw err | |
| 27262 | + } | |
| 27263 | + const opaque = opts && opts.opaque | |
| 27264 | + queueMicrotask(() => callback(err, { opaque })) | |
| 27265 | + } | |
| 27266 | +} | |
| 27267 | + | |
| 27268 | +module.exports = upgrade | |
| 27269 | + | |
| 27270 | + | |
| 27271 | +/***/ }), | |
| 27272 | + | |
| 27273 | +/***/ 6615: | |
| 27274 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27275 | + | |
| 27276 | +"use strict"; | |
| 27277 | + | |
| 27278 | + | |
| 27279 | +module.exports.request = __nccwpck_require__(4043) | |
| 27280 | +module.exports.stream = __nccwpck_require__(3560) | |
| 27281 | +module.exports.pipeline = __nccwpck_require__(6862) | |
| 27282 | +module.exports.upgrade = __nccwpck_require__(1882) | |
| 27283 | +module.exports.connect = __nccwpck_require__(4660) | |
| 27284 | + | |
| 27285 | + | |
| 27286 | +/***/ }), | |
| 27287 | + | |
| 27288 | +/***/ 9927: | |
| 27289 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27290 | + | |
| 27291 | +"use strict"; | |
| 27292 | +// Ported from https://github.com/nodejs/undici/pull/907 | |
| 27293 | + | |
| 27294 | + | |
| 27295 | + | |
| 27296 | +const assert = __nccwpck_require__(2613) | |
| 27297 | +const { Readable } = __nccwpck_require__(2203) | |
| 27298 | +const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8707) | |
| 27299 | +const util = __nccwpck_require__(3440) | |
| 27300 | +const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3440) | |
| 27301 | + | |
| 27302 | +let Blob | |
| 27303 | + | |
| 27304 | +const kConsume = Symbol('kConsume') | |
| 27305 | +const kReading = Symbol('kReading') | |
| 27306 | +const kBody = Symbol('kBody') | |
| 27307 | +const kAbort = Symbol('abort') | |
| 27308 | +const kContentType = Symbol('kContentType') | |
| 27309 | + | |
| 27310 | +const noop = () => {} | |
| 27311 | + | |
| 27312 | +module.exports = class BodyReadable extends Readable { | |
| 27313 | + constructor ({ | |
| 27314 | + resume, | |
| 27315 | + abort, | |
| 27316 | + contentType = '', | |
| 27317 | + highWaterMark = 64 * 1024 // Same as nodejs fs streams. | |
| 27318 | + }) { | |
| 27319 | + super({ | |
| 27320 | + autoDestroy: true, | |
| 27321 | + read: resume, | |
| 27322 | + highWaterMark | |
| 27323 | + }) | |
| 27324 | + | |
| 27325 | + this._readableState.dataEmitted = false | |
| 27326 | + | |
| 27327 | + this[kAbort] = abort | |
| 27328 | + this[kConsume] = null | |
| 27329 | + this[kBody] = null | |
| 27330 | + this[kContentType] = contentType | |
| 27331 | + | |
| 27332 | + // Is stream being consumed through Readable API? | |
| 27333 | + // This is an optimization so that we avoid checking | |
| 27334 | + // for 'data' and 'readable' listeners in the hot path | |
| 27335 | + // inside push(). | |
| 27336 | + this[kReading] = false | |
| 27337 | + } | |
| 27338 | + | |
| 27339 | + destroy (err) { | |
| 27340 | + if (this.destroyed) { | |
| 27341 | + // Node < 16 | |
| 27342 | + return this | |
| 27343 | + } | |
| 27344 | + | |
| 27345 | + if (!err && !this._readableState.endEmitted) { | |
| 27346 | + err = new RequestAbortedError() | |
| 27347 | + } | |
| 27348 | + | |
| 27349 | + if (err) { | |
| 27350 | + this[kAbort]() | |
| 27351 | + } | |
| 27352 | + | |
| 27353 | + return super.destroy(err) | |
| 27354 | + } | |
| 27355 | + | |
| 27356 | + emit (ev, ...args) { | |
| 27357 | + if (ev === 'data') { | |
| 27358 | + // Node < 16.7 | |
| 27359 | + this._readableState.dataEmitted = true | |
| 27360 | + } else if (ev === 'error') { | |
| 27361 | + // Node < 16 | |
| 27362 | + this._readableState.errorEmitted = true | |
| 27363 | + } | |
| 27364 | + return super.emit(ev, ...args) | |
| 27365 | + } | |
| 27366 | + | |
| 27367 | + on (ev, ...args) { | |
| 27368 | + if (ev === 'data' || ev === 'readable') { | |
| 27369 | + this[kReading] = true | |
| 27370 | + } | |
| 27371 | + return super.on(ev, ...args) | |
| 27372 | + } | |
| 27373 | + | |
| 27374 | + addListener (ev, ...args) { | |
| 27375 | + return this.on(ev, ...args) | |
| 27376 | + } | |
| 27377 | + | |
| 27378 | + off (ev, ...args) { | |
| 27379 | + const ret = super.off(ev, ...args) | |
| 27380 | + if (ev === 'data' || ev === 'readable') { | |
| 27381 | + this[kReading] = ( | |
| 27382 | + this.listenerCount('data') > 0 || | |
| 27383 | + this.listenerCount('readable') > 0 | |
| 27384 | + ) | |
| 27385 | + } | |
| 27386 | + return ret | |
| 27387 | + } | |
| 27388 | + | |
| 27389 | + removeListener (ev, ...args) { | |
| 27390 | + return this.off(ev, ...args) | |
| 27391 | + } | |
| 27392 | + | |
| 27393 | + push (chunk) { | |
| 27394 | + if (this[kConsume] && chunk !== null && this.readableLength === 0) { | |
| 27395 | + consumePush(this[kConsume], chunk) | |
| 27396 | + return this[kReading] ? super.push(chunk) : true | |
| 27397 | + } | |
| 27398 | + return super.push(chunk) | |
| 27399 | + } | |
| 27400 | + | |
| 27401 | + // https://fetch.spec.whatwg.org/#dom-body-text | |
| 27402 | + async text () { | |
| 27403 | + return consume(this, 'text') | |
| 27404 | + } | |
| 27405 | + | |
| 27406 | + // https://fetch.spec.whatwg.org/#dom-body-json | |
| 27407 | + async json () { | |
| 27408 | + return consume(this, 'json') | |
| 27409 | + } | |
| 27410 | + | |
| 27411 | + // https://fetch.spec.whatwg.org/#dom-body-blob | |
| 27412 | + async blob () { | |
| 27413 | + return consume(this, 'blob') | |
| 27414 | + } | |
| 27415 | + | |
| 27416 | + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer | |
| 27417 | + async arrayBuffer () { | |
| 27418 | + return consume(this, 'arrayBuffer') | |
| 27419 | + } | |
| 27420 | + | |
| 27421 | + // https://fetch.spec.whatwg.org/#dom-body-formdata | |
| 27422 | + async formData () { | |
| 27423 | + // TODO: Implement. | |
| 27424 | + throw new NotSupportedError() | |
| 27425 | + } | |
| 27426 | + | |
| 27427 | + // https://fetch.spec.whatwg.org/#dom-body-bodyused | |
| 27428 | + get bodyUsed () { | |
| 27429 | + return util.isDisturbed(this) | |
| 27430 | + } | |
| 27431 | + | |
| 27432 | + // https://fetch.spec.whatwg.org/#dom-body-body | |
| 27433 | + get body () { | |
| 27434 | + if (!this[kBody]) { | |
| 27435 | + this[kBody] = ReadableStreamFrom(this) | |
| 27436 | + if (this[kConsume]) { | |
| 27437 | + // TODO: Is this the best way to force a lock? | |
| 27438 | + this[kBody].getReader() // Ensure stream is locked. | |
| 27439 | + assert(this[kBody].locked) | |
| 27440 | + } | |
| 27441 | + } | |
| 27442 | + return this[kBody] | |
| 27443 | + } | |
| 27444 | + | |
| 27445 | + dump (opts) { | |
| 27446 | + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 | |
| 27447 | + const signal = opts && opts.signal | |
| 27448 | + | |
| 27449 | + if (signal) { | |
| 27450 | + try { | |
| 27451 | + if (typeof signal !== 'object' || !('aborted' in signal)) { | |
| 27452 | + throw new InvalidArgumentError('signal must be an AbortSignal') | |
| 27453 | + } | |
| 27454 | + util.throwIfAborted(signal) | |
| 27455 | + } catch (err) { | |
| 27456 | + return Promise.reject(err) | |
| 27457 | + } | |
| 27458 | + } | |
| 27459 | + | |
| 27460 | + if (this.closed) { | |
| 27461 | + return Promise.resolve(null) | |
| 27462 | + } | |
| 27463 | + | |
| 27464 | + return new Promise((resolve, reject) => { | |
| 27465 | + const signalListenerCleanup = signal | |
| 27466 | + ? util.addAbortListener(signal, () => { | |
| 27467 | + this.destroy() | |
| 27468 | + }) | |
| 27469 | + : noop | |
| 27470 | + | |
| 27471 | + this | |
| 27472 | + .on('close', function () { | |
| 27473 | + signalListenerCleanup() | |
| 27474 | + if (signal && signal.aborted) { | |
| 27475 | + reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) | |
| 27476 | + } else { | |
| 27477 | + resolve(null) | |
| 27478 | + } | |
| 27479 | + }) | |
| 27480 | + .on('error', noop) | |
| 27481 | + .on('data', function (chunk) { | |
| 27482 | + limit -= chunk.length | |
| 27483 | + if (limit <= 0) { | |
| 27484 | + this.destroy() | |
| 27485 | + } | |
| 27486 | + }) | |
| 27487 | + .resume() | |
| 27488 | + }) | |
| 27489 | + } | |
| 27490 | +} | |
| 27491 | + | |
| 27492 | +// https://streams.spec.whatwg.org/#readablestream-locked | |
| 27493 | +function isLocked (self) { | |
| 27494 | + // Consume is an implicit lock. | |
| 27495 | + return (self[kBody] && self[kBody].locked === true) || self[kConsume] | |
| 27496 | +} | |
| 27497 | + | |
| 27498 | +// https://fetch.spec.whatwg.org/#body-unusable | |
| 27499 | +function isUnusable (self) { | |
| 27500 | + return util.isDisturbed(self) || isLocked(self) | |
| 27501 | +} | |
| 27502 | + | |
| 27503 | +async function consume (stream, type) { | |
| 27504 | + if (isUnusable(stream)) { | |
| 27505 | + throw new TypeError('unusable') | |
| 27506 | + } | |
| 27507 | + | |
| 27508 | + assert(!stream[kConsume]) | |
| 27509 | + | |
| 27510 | + return new Promise((resolve, reject) => { | |
| 27511 | + stream[kConsume] = { | |
| 27512 | + type, | |
| 27513 | + stream, | |
| 27514 | + resolve, | |
| 27515 | + reject, | |
| 27516 | + length: 0, | |
| 27517 | + body: [] | |
| 27518 | + } | |
| 27519 | + | |
| 27520 | + stream | |
| 27521 | + .on('error', function (err) { | |
| 27522 | + consumeFinish(this[kConsume], err) | |
| 27523 | + }) | |
| 27524 | + .on('close', function () { | |
| 27525 | + if (this[kConsume].body !== null) { | |
| 27526 | + consumeFinish(this[kConsume], new RequestAbortedError()) | |
| 27527 | + } | |
| 27528 | + }) | |
| 27529 | + | |
| 27530 | + process.nextTick(consumeStart, stream[kConsume]) | |
| 27531 | + }) | |
| 27532 | +} | |
| 27533 | + | |
| 27534 | +function consumeStart (consume) { | |
| 27535 | + if (consume.body === null) { | |
| 27536 | + return | |
| 27537 | + } | |
| 27538 | + | |
| 27539 | + const { _readableState: state } = consume.stream | |
| 27540 | + | |
| 27541 | + for (const chunk of state.buffer) { | |
| 27542 | + consumePush(consume, chunk) | |
| 27543 | + } | |
| 27544 | + | |
| 27545 | + if (state.endEmitted) { | |
| 27546 | + consumeEnd(this[kConsume]) | |
| 27547 | + } else { | |
| 27548 | + consume.stream.on('end', function () { | |
| 27549 | + consumeEnd(this[kConsume]) | |
| 27550 | + }) | |
| 27551 | + } | |
| 27552 | + | |
| 27553 | + consume.stream.resume() | |
| 27554 | + | |
| 27555 | + while (consume.stream.read() != null) { | |
| 27556 | + // Loop | |
| 27557 | + } | |
| 27558 | +} | |
| 27559 | + | |
| 27560 | +function consumeEnd (consume) { | |
| 27561 | + const { type, body, resolve, stream, length } = consume | |
| 27562 | + | |
| 27563 | + try { | |
| 27564 | + if (type === 'text') { | |
| 27565 | + resolve(toUSVString(Buffer.concat(body))) | |
| 27566 | + } else if (type === 'json') { | |
| 27567 | + resolve(JSON.parse(Buffer.concat(body))) | |
| 27568 | + } else if (type === 'arrayBuffer') { | |
| 27569 | + const dst = new Uint8Array(length) | |
| 27570 | + | |
| 27571 | + let pos = 0 | |
| 27572 | + for (const buf of body) { | |
| 27573 | + dst.set(buf, pos) | |
| 27574 | + pos += buf.byteLength | |
| 27575 | + } | |
| 27576 | + | |
| 27577 | + resolve(dst.buffer) | |
| 27578 | + } else if (type === 'blob') { | |
| 27579 | + if (!Blob) { | |
| 27580 | + Blob = (__nccwpck_require__(181).Blob) | |
| 27581 | + } | |
| 27582 | + resolve(new Blob(body, { type: stream[kContentType] })) | |
| 27583 | + } | |
| 27584 | + | |
| 27585 | + consumeFinish(consume) | |
| 27586 | + } catch (err) { | |
| 27587 | + stream.destroy(err) | |
| 27588 | + } | |
| 27589 | +} | |
| 27590 | + | |
| 27591 | +function consumePush (consume, chunk) { | |
| 27592 | + consume.length += chunk.length | |
| 27593 | + consume.body.push(chunk) | |
| 27594 | +} | |
| 27595 | + | |
| 27596 | +function consumeFinish (consume, err) { | |
| 27597 | + if (consume.body === null) { | |
| 27598 | + return | |
| 27599 | + } | |
| 27600 | + | |
| 27601 | + if (err) { | |
| 27602 | + consume.reject(err) | |
| 27603 | + } else { | |
| 27604 | + consume.resolve() | |
| 27605 | + } | |
| 27606 | + | |
| 27607 | + consume.type = null | |
| 27608 | + consume.stream = null | |
| 27609 | + consume.resolve = null | |
| 27610 | + consume.reject = null | |
| 27611 | + consume.length = 0 | |
| 27612 | + consume.body = null | |
| 27613 | +} | |
| 27614 | + | |
| 27615 | + | |
| 27616 | +/***/ }), | |
| 27617 | + | |
| 27618 | +/***/ 7655: | |
| 27619 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27620 | + | |
| 27621 | +const assert = __nccwpck_require__(2613) | |
| 27622 | +const { | |
| 27623 | + ResponseStatusCodeError | |
| 27624 | +} = __nccwpck_require__(8707) | |
| 27625 | +const { toUSVString } = __nccwpck_require__(3440) | |
| 27626 | + | |
| 27627 | +async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { | |
| 27628 | + assert(body) | |
| 27629 | + | |
| 27630 | + let chunks = [] | |
| 27631 | + let limit = 0 | |
| 27632 | + | |
| 27633 | + for await (const chunk of body) { | |
| 27634 | + chunks.push(chunk) | |
| 27635 | + limit += chunk.length | |
| 27636 | + if (limit > 128 * 1024) { | |
| 27637 | + chunks = null | |
| 27638 | + break | |
| 27639 | + } | |
| 27640 | + } | |
| 27641 | + | |
| 27642 | + if (statusCode === 204 || !contentType || !chunks) { | |
| 27643 | + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) | |
| 27644 | + return | |
| 27645 | + } | |
| 27646 | + | |
| 27647 | + try { | |
| 27648 | + if (contentType.startsWith('application/json')) { | |
| 27649 | + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) | |
| 27650 | + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) | |
| 27651 | + return | |
| 27652 | + } | |
| 27653 | + | |
| 27654 | + if (contentType.startsWith('text/')) { | |
| 27655 | + const payload = toUSVString(Buffer.concat(chunks)) | |
| 27656 | + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) | |
| 27657 | + return | |
| 27658 | + } | |
| 27659 | + } catch (err) { | |
| 27660 | + // Process in a fallback if error | |
| 27661 | + } | |
| 27662 | + | |
| 27663 | + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) | |
| 27664 | +} | |
| 27665 | + | |
| 27666 | +module.exports = { getResolveErrorBodyCallback } | |
| 27667 | + | |
| 27668 | + | |
| 27669 | +/***/ }), | |
| 27670 | + | |
| 27671 | +/***/ 1093: | |
| 27672 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27673 | + | |
| 27674 | +"use strict"; | |
| 27675 | + | |
| 27676 | + | |
| 27677 | +const { | |
| 27678 | + BalancedPoolMissingUpstreamError, | |
| 27679 | + InvalidArgumentError | |
| 27680 | +} = __nccwpck_require__(8707) | |
| 27681 | +const { | |
| 27682 | + PoolBase, | |
| 27683 | + kClients, | |
| 27684 | + kNeedDrain, | |
| 27685 | + kAddClient, | |
| 27686 | + kRemoveClient, | |
| 27687 | + kGetDispatcher | |
| 27688 | +} = __nccwpck_require__(8640) | |
| 27689 | +const Pool = __nccwpck_require__(5076) | |
| 27690 | +const { kUrl, kInterceptors } = __nccwpck_require__(6443) | |
| 27691 | +const { parseOrigin } = __nccwpck_require__(3440) | |
| 27692 | +const kFactory = Symbol('factory') | |
| 27693 | + | |
| 27694 | +const kOptions = Symbol('options') | |
| 27695 | +const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') | |
| 27696 | +const kCurrentWeight = Symbol('kCurrentWeight') | |
| 27697 | +const kIndex = Symbol('kIndex') | |
| 27698 | +const kWeight = Symbol('kWeight') | |
| 27699 | +const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') | |
| 27700 | +const kErrorPenalty = Symbol('kErrorPenalty') | |
| 27701 | + | |
| 27702 | +function getGreatestCommonDivisor (a, b) { | |
| 27703 | + if (b === 0) return a | |
| 27704 | + return getGreatestCommonDivisor(b, a % b) | |
| 27705 | +} | |
| 27706 | + | |
| 27707 | +function defaultFactory (origin, opts) { | |
| 27708 | + return new Pool(origin, opts) | |
| 27709 | +} | |
| 27710 | + | |
| 27711 | +class BalancedPool extends PoolBase { | |
| 27712 | + constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { | |
| 27713 | + super() | |
| 27714 | + | |
| 27715 | + this[kOptions] = opts | |
| 27716 | + this[kIndex] = -1 | |
| 27717 | + this[kCurrentWeight] = 0 | |
| 27718 | + | |
| 27719 | + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 | |
| 27720 | + this[kErrorPenalty] = this[kOptions].errorPenalty || 15 | |
| 27721 | + | |
| 27722 | + if (!Array.isArray(upstreams)) { | |
| 27723 | + upstreams = [upstreams] | |
| 27724 | + } | |
| 27725 | + | |
| 27726 | + if (typeof factory !== 'function') { | |
| 27727 | + throw new InvalidArgumentError('factory must be a function.') | |
| 27728 | + } | |
| 27729 | + | |
| 27730 | + this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) | |
| 27731 | + ? opts.interceptors.BalancedPool | |
| 27732 | + : [] | |
| 27733 | + this[kFactory] = factory | |
| 27734 | + | |
| 27735 | + for (const upstream of upstreams) { | |
| 27736 | + this.addUpstream(upstream) | |
| 27737 | + } | |
| 27738 | + this._updateBalancedPoolStats() | |
| 27739 | + } | |
| 27740 | + | |
| 27741 | + addUpstream (upstream) { | |
| 27742 | + const upstreamOrigin = parseOrigin(upstream).origin | |
| 27743 | + | |
| 27744 | + if (this[kClients].find((pool) => ( | |
| 27745 | + pool[kUrl].origin === upstreamOrigin && | |
| 27746 | + pool.closed !== true && | |
| 27747 | + pool.destroyed !== true | |
| 27748 | + ))) { | |
| 27749 | + return this | |
| 27750 | + } | |
| 27751 | + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) | |
| 27752 | + | |
| 27753 | + this[kAddClient](pool) | |
| 27754 | + pool.on('connect', () => { | |
| 27755 | + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) | |
| 27756 | + }) | |
| 27757 | + | |
| 27758 | + pool.on('connectionError', () => { | |
| 27759 | + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) | |
| 27760 | + this._updateBalancedPoolStats() | |
| 27761 | + }) | |
| 27762 | + | |
| 27763 | + pool.on('disconnect', (...args) => { | |
| 27764 | + const err = args[2] | |
| 27765 | + if (err && err.code === 'UND_ERR_SOCKET') { | |
| 27766 | + // decrease the weight of the pool. | |
| 27767 | + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) | |
| 27768 | + this._updateBalancedPoolStats() | |
| 27769 | + } | |
| 27770 | + }) | |
| 27771 | + | |
| 27772 | + for (const client of this[kClients]) { | |
| 27773 | + client[kWeight] = this[kMaxWeightPerServer] | |
| 27774 | + } | |
| 27775 | + | |
| 27776 | + this._updateBalancedPoolStats() | |
| 27777 | + | |
| 27778 | + return this | |
| 27779 | + } | |
| 27780 | + | |
| 27781 | + _updateBalancedPoolStats () { | |
| 27782 | + this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) | |
| 27783 | + } | |
| 27784 | + | |
| 27785 | + removeUpstream (upstream) { | |
| 27786 | + const upstreamOrigin = parseOrigin(upstream).origin | |
| 27787 | + | |
| 27788 | + const pool = this[kClients].find((pool) => ( | |
| 27789 | + pool[kUrl].origin === upstreamOrigin && | |
| 27790 | + pool.closed !== true && | |
| 27791 | + pool.destroyed !== true | |
| 27792 | + )) | |
| 27793 | + | |
| 27794 | + if (pool) { | |
| 27795 | + this[kRemoveClient](pool) | |
| 27796 | + } | |
| 27797 | + | |
| 27798 | + return this | |
| 27799 | + } | |
| 27800 | + | |
| 27801 | + get upstreams () { | |
| 27802 | + return this[kClients] | |
| 27803 | + .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) | |
| 27804 | + .map((p) => p[kUrl].origin) | |
| 27805 | + } | |
| 27806 | + | |
| 27807 | + [kGetDispatcher] () { | |
| 27808 | + // We validate that pools is greater than 0, | |
| 27809 | + // otherwise we would have to wait until an upstream | |
| 27810 | + // is added, which might never happen. | |
| 27811 | + if (this[kClients].length === 0) { | |
| 27812 | + throw new BalancedPoolMissingUpstreamError() | |
| 27813 | + } | |
| 27814 | + | |
| 27815 | + const dispatcher = this[kClients].find(dispatcher => ( | |
| 27816 | + !dispatcher[kNeedDrain] && | |
| 27817 | + dispatcher.closed !== true && | |
| 27818 | + dispatcher.destroyed !== true | |
| 27819 | + )) | |
| 27820 | + | |
| 27821 | + if (!dispatcher) { | |
| 27822 | + return | |
| 27823 | + } | |
| 27824 | + | |
| 27825 | + const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) | |
| 27826 | + | |
| 27827 | + if (allClientsBusy) { | |
| 27828 | + return | |
| 27829 | + } | |
| 27830 | + | |
| 27831 | + let counter = 0 | |
| 27832 | + | |
| 27833 | + let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) | |
| 27834 | + | |
| 27835 | + while (counter++ < this[kClients].length) { | |
| 27836 | + this[kIndex] = (this[kIndex] + 1) % this[kClients].length | |
| 27837 | + const pool = this[kClients][this[kIndex]] | |
| 27838 | + | |
| 27839 | + // find pool index with the largest weight | |
| 27840 | + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { | |
| 27841 | + maxWeightIndex = this[kIndex] | |
| 27842 | + } | |
| 27843 | + | |
| 27844 | + // decrease the current weight every `this[kClients].length`. | |
| 27845 | + if (this[kIndex] === 0) { | |
| 27846 | + // Set the current weight to the next lower weight. | |
| 27847 | + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] | |
| 27848 | + | |
| 27849 | + if (this[kCurrentWeight] <= 0) { | |
| 27850 | + this[kCurrentWeight] = this[kMaxWeightPerServer] | |
| 27851 | + } | |
| 27852 | + } | |
| 27853 | + if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { | |
| 27854 | + return pool | |
| 27855 | + } | |
| 27856 | + } | |
| 27857 | + | |
| 27858 | + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] | |
| 27859 | + this[kIndex] = maxWeightIndex | |
| 27860 | + return this[kClients][maxWeightIndex] | |
| 27861 | + } | |
| 27862 | +} | |
| 27863 | + | |
| 27864 | +module.exports = BalancedPool | |
| 27865 | + | |
| 27866 | + | |
| 27867 | +/***/ }), | |
| 27868 | + | |
| 27869 | +/***/ 479: | |
| 27870 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27871 | + | |
| 27872 | +"use strict"; | |
| 27873 | + | |
| 27874 | + | |
| 27875 | +const { kConstruct } = __nccwpck_require__(296) | |
| 27876 | +const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(3993) | |
| 27877 | +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3440) | |
| 27878 | +const { kHeadersList } = __nccwpck_require__(6443) | |
| 27879 | +const { webidl } = __nccwpck_require__(4222) | |
| 27880 | +const { Response, cloneResponse } = __nccwpck_require__(8676) | |
| 27881 | +const { Request } = __nccwpck_require__(5194) | |
| 27882 | +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) | |
| 27883 | +const { fetching } = __nccwpck_require__(2315) | |
| 27884 | +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(5523) | |
| 27885 | +const assert = __nccwpck_require__(2613) | |
| 27886 | +const { getGlobalDispatcher } = __nccwpck_require__(2581) | |
| 27887 | + | |
| 27888 | +/** | |
| 27889 | + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation | |
| 27890 | + * @typedef {Object} CacheBatchOperation | |
| 27891 | + * @property {'delete' | 'put'} type | |
| 27892 | + * @property {any} request | |
| 27893 | + * @property {any} response | |
| 27894 | + * @property {import('../../types/cache').CacheQueryOptions} options | |
| 27895 | + */ | |
| 27896 | + | |
| 27897 | +/** | |
| 27898 | + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list | |
| 27899 | + * @typedef {[any, any][]} requestResponseList | |
| 27900 | + */ | |
| 27901 | + | |
| 27902 | +class Cache { | |
| 27903 | + /** | |
| 27904 | + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list | |
| 27905 | + * @type {requestResponseList} | |
| 27906 | + */ | |
| 27907 | + #relevantRequestResponseList | |
| 27908 | + | |
| 27909 | + constructor () { | |
| 27910 | + if (arguments[0] !== kConstruct) { | |
| 27911 | + webidl.illegalConstructor() | |
| 27912 | + } | |
| 27913 | + | |
| 27914 | + this.#relevantRequestResponseList = arguments[1] | |
| 27915 | + } | |
| 27916 | + | |
| 27917 | + async match (request, options = {}) { | |
| 27918 | + webidl.brandCheck(this, Cache) | |
| 27919 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) | |
| 27920 | + | |
| 27921 | + request = webidl.converters.RequestInfo(request) | |
| 27922 | + options = webidl.converters.CacheQueryOptions(options) | |
| 27923 | + | |
| 27924 | + const p = await this.matchAll(request, options) | |
| 27925 | + | |
| 27926 | + if (p.length === 0) { | |
| 27927 | + return | |
| 27928 | + } | |
| 27929 | + | |
| 27930 | + return p[0] | |
| 27931 | + } | |
| 27932 | + | |
| 27933 | + async matchAll (request = undefined, options = {}) { | |
| 27934 | + webidl.brandCheck(this, Cache) | |
| 27935 | + | |
| 27936 | + if (request !== undefined) request = webidl.converters.RequestInfo(request) | |
| 27937 | + options = webidl.converters.CacheQueryOptions(options) | |
| 27938 | + | |
| 27939 | + // 1. | |
| 27940 | + let r = null | |
| 27941 | + | |
| 27942 | + // 2. | |
| 27943 | + if (request !== undefined) { | |
| 27944 | + if (request instanceof Request) { | |
| 27945 | + // 2.1.1 | |
| 27946 | + r = request[kState] | |
| 27947 | + | |
| 27948 | + // 2.1.2 | |
| 27949 | + if (r.method !== 'GET' && !options.ignoreMethod) { | |
| 27950 | + return [] | |
| 27951 | + } | |
| 27952 | + } else if (typeof request === 'string') { | |
| 27953 | + // 2.2.1 | |
| 27954 | + r = new Request(request)[kState] | |
| 27955 | + } | |
| 27956 | + } | |
| 27957 | + | |
| 27958 | + // 5. | |
| 27959 | + // 5.1 | |
| 27960 | + const responses = [] | |
| 27961 | + | |
| 27962 | + // 5.2 | |
| 27963 | + if (request === undefined) { | |
| 27964 | + // 5.2.1 | |
| 27965 | + for (const requestResponse of this.#relevantRequestResponseList) { | |
| 27966 | + responses.push(requestResponse[1]) | |
| 27967 | + } | |
| 27968 | + } else { // 5.3 | |
| 27969 | + // 5.3.1 | |
| 27970 | + const requestResponses = this.#queryCache(r, options) | |
| 27971 | + | |
| 27972 | + // 5.3.2 | |
| 27973 | + for (const requestResponse of requestResponses) { | |
| 27974 | + responses.push(requestResponse[1]) | |
| 27975 | + } | |
| 27976 | + } | |
| 27977 | + | |
| 27978 | + // 5.4 | |
| 27979 | + // We don't implement CORs so we don't need to loop over the responses, yay! | |
| 27980 | + | |
| 27981 | + // 5.5.1 | |
| 27982 | + const responseList = [] | |
| 27983 | + | |
| 27984 | + // 5.5.2 | |
| 27985 | + for (const response of responses) { | |
| 27986 | + // 5.5.2.1 | |
| 27987 | + const responseObject = new Response(response.body?.source ?? null) | |
| 27988 | + const body = responseObject[kState].body | |
| 27989 | + responseObject[kState] = response | |
| 27990 | + responseObject[kState].body = body | |
| 27991 | + responseObject[kHeaders][kHeadersList] = response.headersList | |
| 27992 | + responseObject[kHeaders][kGuard] = 'immutable' | |
| 27993 | + | |
| 27994 | + responseList.push(responseObject) | |
| 27995 | + } | |
| 27996 | + | |
| 27997 | + // 6. | |
| 27998 | + return Object.freeze(responseList) | |
| 27999 | + } | |
| 28000 | + | |
| 28001 | + async add (request) { | |
| 28002 | + webidl.brandCheck(this, Cache) | |
| 28003 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) | |
| 28004 | + | |
| 28005 | + request = webidl.converters.RequestInfo(request) | |
| 28006 | + | |
| 28007 | + // 1. | |
| 28008 | + const requests = [request] | |
| 28009 | + | |
| 28010 | + // 2. | |
| 28011 | + const responseArrayPromise = this.addAll(requests) | |
| 28012 | + | |
| 28013 | + // 3. | |
| 28014 | + return await responseArrayPromise | |
| 28015 | + } | |
| 28016 | + | |
| 28017 | + async addAll (requests) { | |
| 28018 | + webidl.brandCheck(this, Cache) | |
| 28019 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) | |
| 28020 | + | |
| 28021 | + requests = webidl.converters['sequence<RequestInfo>'](requests) | |
| 28022 | + | |
| 28023 | + // 1. | |
| 28024 | + const responsePromises = [] | |
| 28025 | + | |
| 28026 | + // 2. | |
| 28027 | + const requestList = [] | |
| 28028 | + | |
| 28029 | + // 3. | |
| 28030 | + for (const request of requests) { | |
| 28031 | + if (typeof request === 'string') { | |
| 28032 | + continue | |
| 28033 | + } | |
| 28034 | + | |
| 28035 | + // 3.1 | |
| 28036 | + const r = request[kState] | |
| 28037 | + | |
| 28038 | + // 3.2 | |
| 28039 | + if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { | |
| 28040 | + throw webidl.errors.exception({ | |
| 28041 | + header: 'Cache.addAll', | |
| 28042 | + message: 'Expected http/s scheme when method is not GET.' | |
| 28043 | + }) | |
| 28044 | + } | |
| 28045 | + } | |
| 28046 | + | |
| 28047 | + // 4. | |
| 28048 | + /** @type {ReturnType<typeof fetching>[]} */ | |
| 28049 | + const fetchControllers = [] | |
| 28050 | + | |
| 28051 | + // 5. | |
| 28052 | + for (const request of requests) { | |
| 28053 | + // 5.1 | |
| 28054 | + const r = new Request(request)[kState] | |
| 28055 | + | |
| 28056 | + // 5.2 | |
| 28057 | + if (!urlIsHttpHttpsScheme(r.url)) { | |
| 28058 | + throw webidl.errors.exception({ | |
| 28059 | + header: 'Cache.addAll', | |
| 28060 | + message: 'Expected http/s scheme.' | |
| 28061 | + }) | |
| 28062 | + } | |
| 28063 | + | |
| 28064 | + // 5.4 | |
| 28065 | + r.initiator = 'fetch' | |
| 28066 | + r.destination = 'subresource' | |
| 28067 | + | |
| 28068 | + // 5.5 | |
| 28069 | + requestList.push(r) | |
| 28070 | + | |
| 28071 | + // 5.6 | |
| 28072 | + const responsePromise = createDeferredPromise() | |
| 28073 | + | |
| 28074 | + // 5.7 | |
| 28075 | + fetchControllers.push(fetching({ | |
| 28076 | + request: r, | |
| 28077 | + dispatcher: getGlobalDispatcher(), | |
| 28078 | + processResponse (response) { | |
| 28079 | + // 1. | |
| 28080 | + if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { | |
| 28081 | + responsePromise.reject(webidl.errors.exception({ | |
| 28082 | + header: 'Cache.addAll', | |
| 28083 | + message: 'Received an invalid status code or the request failed.' | |
| 28084 | + })) | |
| 28085 | + } else if (response.headersList.contains('vary')) { // 2. | |
| 28086 | + // 2.1 | |
| 28087 | + const fieldValues = getFieldValues(response.headersList.get('vary')) | |
| 28088 | + | |
| 28089 | + // 2.2 | |
| 28090 | + for (const fieldValue of fieldValues) { | |
| 28091 | + // 2.2.1 | |
| 28092 | + if (fieldValue === '*') { | |
| 28093 | + responsePromise.reject(webidl.errors.exception({ | |
| 28094 | + header: 'Cache.addAll', | |
| 28095 | + message: 'invalid vary field value' | |
| 28096 | + })) | |
| 28097 | + | |
| 28098 | + for (const controller of fetchControllers) { | |
| 28099 | + controller.abort() | |
| 28100 | + } | |
| 28101 | + | |
| 28102 | + return | |
| 28103 | + } | |
| 28104 | + } | |
| 28105 | + } | |
| 28106 | + }, | |
| 28107 | + processResponseEndOfBody (response) { | |
| 28108 | + // 1. | |
| 28109 | + if (response.aborted) { | |
| 28110 | + responsePromise.reject(new DOMException('aborted', 'AbortError')) | |
| 28111 | + return | |
| 28112 | + } | |
| 28113 | + | |
| 28114 | + // 2. | |
| 28115 | + responsePromise.resolve(response) | |
| 28116 | + } | |
| 28117 | + })) | |
| 28118 | + | |
| 28119 | + // 5.8 | |
| 28120 | + responsePromises.push(responsePromise.promise) | |
| 28121 | + } | |
| 28122 | + | |
| 28123 | + // 6. | |
| 28124 | + const p = Promise.all(responsePromises) | |
| 28125 | + | |
| 28126 | + // 7. | |
| 28127 | + const responses = await p | |
| 28128 | + | |
| 28129 | + // 7.1 | |
| 28130 | + const operations = [] | |
| 28131 | + | |
| 28132 | + // 7.2 | |
| 28133 | + let index = 0 | |
| 28134 | + | |
| 28135 | + // 7.3 | |
| 28136 | + for (const response of responses) { | |
| 28137 | + // 7.3.1 | |
| 28138 | + /** @type {CacheBatchOperation} */ | |
| 28139 | + const operation = { | |
| 28140 | + type: 'put', // 7.3.2 | |
| 28141 | + request: requestList[index], // 7.3.3 | |
| 28142 | + response // 7.3.4 | |
| 28143 | + } | |
| 28144 | + | |
| 28145 | + operations.push(operation) // 7.3.5 | |
| 28146 | + | |
| 28147 | + index++ // 7.3.6 | |
| 28148 | + } | |
| 28149 | + | |
| 28150 | + // 7.5 | |
| 28151 | + const cacheJobPromise = createDeferredPromise() | |
| 28152 | + | |
| 28153 | + // 7.6.1 | |
| 28154 | + let errorData = null | |
| 28155 | + | |
| 28156 | + // 7.6.2 | |
| 28157 | + try { | |
| 28158 | + this.#batchCacheOperations(operations) | |
| 28159 | + } catch (e) { | |
| 28160 | + errorData = e | |
| 28161 | + } | |
| 28162 | + | |
| 28163 | + // 7.6.3 | |
| 28164 | + queueMicrotask(() => { | |
| 28165 | + // 7.6.3.1 | |
| 28166 | + if (errorData === null) { | |
| 28167 | + cacheJobPromise.resolve(undefined) | |
| 28168 | + } else { | |
| 28169 | + // 7.6.3.2 | |
| 28170 | + cacheJobPromise.reject(errorData) | |
| 28171 | + } | |
| 28172 | + }) | |
| 28173 | + | |
| 28174 | + // 7.7 | |
| 28175 | + return cacheJobPromise.promise | |
| 28176 | + } | |
| 28177 | + | |
| 28178 | + async put (request, response) { | |
| 28179 | + webidl.brandCheck(this, Cache) | |
| 28180 | + webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) | |
| 28181 | + | |
| 28182 | + request = webidl.converters.RequestInfo(request) | |
| 28183 | + response = webidl.converters.Response(response) | |
| 28184 | + | |
| 28185 | + // 1. | |
| 28186 | + let innerRequest = null | |
| 28187 | + | |
| 28188 | + // 2. | |
| 28189 | + if (request instanceof Request) { | |
| 28190 | + innerRequest = request[kState] | |
| 28191 | + } else { // 3. | |
| 28192 | + innerRequest = new Request(request)[kState] | |
| 28193 | + } | |
| 28194 | + | |
| 28195 | + // 4. | |
| 28196 | + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { | |
| 28197 | + throw webidl.errors.exception({ | |
| 28198 | + header: 'Cache.put', | |
| 28199 | + message: 'Expected an http/s scheme when method is not GET' | |
| 28200 | + }) | |
| 28201 | + } | |
| 28202 | + | |
| 28203 | + // 5. | |
| 28204 | + const innerResponse = response[kState] | |
| 28205 | + | |
| 28206 | + // 6. | |
| 28207 | + if (innerResponse.status === 206) { | |
| 28208 | + throw webidl.errors.exception({ | |
| 28209 | + header: 'Cache.put', | |
| 28210 | + message: 'Got 206 status' | |
| 28211 | + }) | |
| 28212 | + } | |
| 28213 | + | |
| 28214 | + // 7. | |
| 28215 | + if (innerResponse.headersList.contains('vary')) { | |
| 28216 | + // 7.1. | |
| 28217 | + const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) | |
| 28218 | + | |
| 28219 | + // 7.2. | |
| 28220 | + for (const fieldValue of fieldValues) { | |
| 28221 | + // 7.2.1 | |
| 28222 | + if (fieldValue === '*') { | |
| 28223 | + throw webidl.errors.exception({ | |
| 28224 | + header: 'Cache.put', | |
| 28225 | + message: 'Got * vary field value' | |
| 28226 | + }) | |
| 28227 | + } | |
| 28228 | + } | |
| 28229 | + } | |
| 28230 | + | |
| 28231 | + // 8. | |
| 28232 | + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { | |
| 28233 | + throw webidl.errors.exception({ | |
| 28234 | + header: 'Cache.put', | |
| 28235 | + message: 'Response body is locked or disturbed' | |
| 28236 | + }) | |
| 28237 | + } | |
| 28238 | + | |
| 28239 | + // 9. | |
| 28240 | + const clonedResponse = cloneResponse(innerResponse) | |
| 28241 | + | |
| 28242 | + // 10. | |
| 28243 | + const bodyReadPromise = createDeferredPromise() | |
| 28244 | + | |
| 28245 | + // 11. | |
| 28246 | + if (innerResponse.body != null) { | |
| 28247 | + // 11.1 | |
| 28248 | + const stream = innerResponse.body.stream | |
| 28249 | + | |
| 28250 | + // 11.2 | |
| 28251 | + const reader = stream.getReader() | |
| 28252 | + | |
| 28253 | + // 11.3 | |
| 28254 | + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) | |
| 28255 | + } else { | |
| 28256 | + bodyReadPromise.resolve(undefined) | |
| 28257 | + } | |
| 28258 | + | |
| 28259 | + // 12. | |
| 28260 | + /** @type {CacheBatchOperation[]} */ | |
| 28261 | + const operations = [] | |
| 28262 | + | |
| 28263 | + // 13. | |
| 28264 | + /** @type {CacheBatchOperation} */ | |
| 28265 | + const operation = { | |
| 28266 | + type: 'put', // 14. | |
| 28267 | + request: innerRequest, // 15. | |
| 28268 | + response: clonedResponse // 16. | |
| 28269 | + } | |
| 28270 | + | |
| 28271 | + // 17. | |
| 28272 | + operations.push(operation) | |
| 28273 | + | |
| 28274 | + // 19. | |
| 28275 | + const bytes = await bodyReadPromise.promise | |
| 28276 | + | |
| 28277 | + if (clonedResponse.body != null) { | |
| 28278 | + clonedResponse.body.source = bytes | |
| 28279 | + } | |
| 28280 | + | |
| 28281 | + // 19.1 | |
| 28282 | + const cacheJobPromise = createDeferredPromise() | |
| 28283 | + | |
| 28284 | + // 19.2.1 | |
| 28285 | + let errorData = null | |
| 28286 | + | |
| 28287 | + // 19.2.2 | |
| 28288 | + try { | |
| 28289 | + this.#batchCacheOperations(operations) | |
| 28290 | + } catch (e) { | |
| 28291 | + errorData = e | |
| 28292 | + } | |
| 28293 | + | |
| 28294 | + // 19.2.3 | |
| 28295 | + queueMicrotask(() => { | |
| 28296 | + // 19.2.3.1 | |
| 28297 | + if (errorData === null) { | |
| 28298 | + cacheJobPromise.resolve() | |
| 28299 | + } else { // 19.2.3.2 | |
| 28300 | + cacheJobPromise.reject(errorData) | |
| 28301 | + } | |
| 28302 | + }) | |
| 28303 | + | |
| 28304 | + return cacheJobPromise.promise | |
| 28305 | + } | |
| 28306 | + | |
| 28307 | + async delete (request, options = {}) { | |
| 28308 | + webidl.brandCheck(this, Cache) | |
| 28309 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) | |
| 28310 | + | |
| 28311 | + request = webidl.converters.RequestInfo(request) | |
| 28312 | + options = webidl.converters.CacheQueryOptions(options) | |
| 28313 | + | |
| 28314 | + /** | |
| 28315 | + * @type {Request} | |
| 28316 | + */ | |
| 28317 | + let r = null | |
| 28318 | + | |
| 28319 | + if (request instanceof Request) { | |
| 28320 | + r = request[kState] | |
| 28321 | + | |
| 28322 | + if (r.method !== 'GET' && !options.ignoreMethod) { | |
| 28323 | + return false | |
| 28324 | + } | |
| 28325 | + } else { | |
| 28326 | + assert(typeof request === 'string') | |
| 28327 | + | |
| 28328 | + r = new Request(request)[kState] | |
| 28329 | + } | |
| 28330 | + | |
| 28331 | + /** @type {CacheBatchOperation[]} */ | |
| 28332 | + const operations = [] | |
| 28333 | + | |
| 28334 | + /** @type {CacheBatchOperation} */ | |
| 28335 | + const operation = { | |
| 28336 | + type: 'delete', | |
| 28337 | + request: r, | |
| 28338 | + options | |
| 28339 | + } | |
| 28340 | + | |
| 28341 | + operations.push(operation) | |
| 28342 | + | |
| 28343 | + const cacheJobPromise = createDeferredPromise() | |
| 28344 | + | |
| 28345 | + let errorData = null | |
| 28346 | + let requestResponses | |
| 28347 | + | |
| 28348 | + try { | |
| 28349 | + requestResponses = this.#batchCacheOperations(operations) | |
| 28350 | + } catch (e) { | |
| 28351 | + errorData = e | |
| 28352 | + } | |
| 28353 | + | |
| 28354 | + queueMicrotask(() => { | |
| 28355 | + if (errorData === null) { | |
| 28356 | + cacheJobPromise.resolve(!!requestResponses?.length) | |
| 28357 | + } else { | |
| 28358 | + cacheJobPromise.reject(errorData) | |
| 28359 | + } | |
| 28360 | + }) | |
| 28361 | + | |
| 28362 | + return cacheJobPromise.promise | |
| 28363 | + } | |
| 28364 | + | |
| 28365 | + /** | |
| 28366 | + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys | |
| 28367 | + * @param {any} request | |
| 28368 | + * @param {import('../../types/cache').CacheQueryOptions} options | |
| 28369 | + * @returns {readonly Request[]} | |
| 28370 | + */ | |
| 28371 | + async keys (request = undefined, options = {}) { | |
| 28372 | + webidl.brandCheck(this, Cache) | |
| 28373 | + | |
| 28374 | + if (request !== undefined) request = webidl.converters.RequestInfo(request) | |
| 28375 | + options = webidl.converters.CacheQueryOptions(options) | |
| 28376 | + | |
| 28377 | + // 1. | |
| 28378 | + let r = null | |
| 28379 | + | |
| 28380 | + // 2. | |
| 28381 | + if (request !== undefined) { | |
| 28382 | + // 2.1 | |
| 28383 | + if (request instanceof Request) { | |
| 28384 | + // 2.1.1 | |
| 28385 | + r = request[kState] | |
| 28386 | + | |
| 28387 | + // 2.1.2 | |
| 28388 | + if (r.method !== 'GET' && !options.ignoreMethod) { | |
| 28389 | + return [] | |
| 28390 | + } | |
| 28391 | + } else if (typeof request === 'string') { // 2.2 | |
| 28392 | + r = new Request(request)[kState] | |
| 28393 | + } | |
| 28394 | + } | |
| 28395 | + | |
| 28396 | + // 4. | |
| 28397 | + const promise = createDeferredPromise() | |
| 28398 | + | |
| 28399 | + // 5. | |
| 28400 | + // 5.1 | |
| 28401 | + const requests = [] | |
| 28402 | + | |
| 28403 | + // 5.2 | |
| 28404 | + if (request === undefined) { | |
| 28405 | + // 5.2.1 | |
| 28406 | + for (const requestResponse of this.#relevantRequestResponseList) { | |
| 28407 | + // 5.2.1.1 | |
| 28408 | + requests.push(requestResponse[0]) | |
| 28409 | + } | |
| 28410 | + } else { // 5.3 | |
| 28411 | + // 5.3.1 | |
| 28412 | + const requestResponses = this.#queryCache(r, options) | |
| 28413 | + | |
| 28414 | + // 5.3.2 | |
| 28415 | + for (const requestResponse of requestResponses) { | |
| 28416 | + // 5.3.2.1 | |
| 28417 | + requests.push(requestResponse[0]) | |
| 28418 | + } | |
| 28419 | + } | |
| 28420 | + | |
| 28421 | + // 5.4 | |
| 28422 | + queueMicrotask(() => { | |
| 28423 | + // 5.4.1 | |
| 28424 | + const requestList = [] | |
| 28425 | + | |
| 28426 | + // 5.4.2 | |
| 28427 | + for (const request of requests) { | |
| 28428 | + const requestObject = new Request('https://a') | |
| 28429 | + requestObject[kState] = request | |
| 28430 | + requestObject[kHeaders][kHeadersList] = request.headersList | |
| 28431 | + requestObject[kHeaders][kGuard] = 'immutable' | |
| 28432 | + requestObject[kRealm] = request.client | |
| 28433 | + | |
| 28434 | + // 5.4.2.1 | |
| 28435 | + requestList.push(requestObject) | |
| 28436 | + } | |
| 28437 | + | |
| 28438 | + // 5.4.3 | |
| 28439 | + promise.resolve(Object.freeze(requestList)) | |
| 28440 | + }) | |
| 28441 | + | |
| 28442 | + return promise.promise | |
| 28443 | + } | |
| 28444 | + | |
| 28445 | + /** | |
| 28446 | + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm | |
| 28447 | + * @param {CacheBatchOperation[]} operations | |
| 28448 | + * @returns {requestResponseList} | |
| 28449 | + */ | |
| 28450 | + #batchCacheOperations (operations) { | |
| 28451 | + // 1. | |
| 28452 | + const cache = this.#relevantRequestResponseList | |
| 28453 | + | |
| 28454 | + // 2. | |
| 28455 | + const backupCache = [...cache] | |
| 28456 | + | |
| 28457 | + // 3. | |
| 28458 | + const addedItems = [] | |
| 28459 | + | |
| 28460 | + // 4.1 | |
| 28461 | + const resultList = [] | |
| 28462 | + | |
| 28463 | + try { | |
| 28464 | + // 4.2 | |
| 28465 | + for (const operation of operations) { | |
| 28466 | + // 4.2.1 | |
| 28467 | + if (operation.type !== 'delete' && operation.type !== 'put') { | |
| 28468 | + throw webidl.errors.exception({ | |
| 28469 | + header: 'Cache.#batchCacheOperations', | |
| 28470 | + message: 'operation type does not match "delete" or "put"' | |
| 28471 | + }) | |
| 28472 | + } | |
| 28473 | + | |
| 28474 | + // 4.2.2 | |
| 28475 | + if (operation.type === 'delete' && operation.response != null) { | |
| 28476 | + throw webidl.errors.exception({ | |
| 28477 | + header: 'Cache.#batchCacheOperations', | |
| 28478 | + message: 'delete operation should not have an associated response' | |
| 28479 | + }) | |
| 28480 | + } | |
| 28481 | + | |
| 28482 | + // 4.2.3 | |
| 28483 | + if (this.#queryCache(operation.request, operation.options, addedItems).length) { | |
| 28484 | + throw new DOMException('???', 'InvalidStateError') | |
| 28485 | + } | |
| 28486 | + | |
| 28487 | + // 4.2.4 | |
| 28488 | + let requestResponses | |
| 28489 | + | |
| 28490 | + // 4.2.5 | |
| 28491 | + if (operation.type === 'delete') { | |
| 28492 | + // 4.2.5.1 | |
| 28493 | + requestResponses = this.#queryCache(operation.request, operation.options) | |
| 28494 | + | |
| 28495 | + // TODO: the spec is wrong, this is needed to pass WPTs | |
| 28496 | + if (requestResponses.length === 0) { | |
| 28497 | + return [] | |
| 28498 | + } | |
| 28499 | + | |
| 28500 | + // 4.2.5.2 | |
| 28501 | + for (const requestResponse of requestResponses) { | |
| 28502 | + const idx = cache.indexOf(requestResponse) | |
| 28503 | + assert(idx !== -1) | |
| 28504 | + | |
| 28505 | + // 4.2.5.2.1 | |
| 28506 | + cache.splice(idx, 1) | |
| 28507 | + } | |
| 28508 | + } else if (operation.type === 'put') { // 4.2.6 | |
| 28509 | + // 4.2.6.1 | |
| 28510 | + if (operation.response == null) { | |
| 28511 | + throw webidl.errors.exception({ | |
| 28512 | + header: 'Cache.#batchCacheOperations', | |
| 28513 | + message: 'put operation should have an associated response' | |
| 28514 | + }) | |
| 28515 | + } | |
| 28516 | + | |
| 28517 | + // 4.2.6.2 | |
| 28518 | + const r = operation.request | |
| 28519 | + | |
| 28520 | + // 4.2.6.3 | |
| 28521 | + if (!urlIsHttpHttpsScheme(r.url)) { | |
| 28522 | + throw webidl.errors.exception({ | |
| 28523 | + header: 'Cache.#batchCacheOperations', | |
| 28524 | + message: 'expected http or https scheme' | |
| 28525 | + }) | |
| 28526 | + } | |
| 28527 | + | |
| 28528 | + // 4.2.6.4 | |
| 28529 | + if (r.method !== 'GET') { | |
| 28530 | + throw webidl.errors.exception({ | |
| 28531 | + header: 'Cache.#batchCacheOperations', | |
| 28532 | + message: 'not get method' | |
| 28533 | + }) | |
| 28534 | + } | |
| 28535 | + | |
| 28536 | + // 4.2.6.5 | |
| 28537 | + if (operation.options != null) { | |
| 28538 | + throw webidl.errors.exception({ | |
| 28539 | + header: 'Cache.#batchCacheOperations', | |
| 28540 | + message: 'options must not be defined' | |
| 28541 | + }) | |
| 28542 | + } | |
| 28543 | + | |
| 28544 | + // 4.2.6.6 | |
| 28545 | + requestResponses = this.#queryCache(operation.request) | |
| 28546 | + | |
| 28547 | + // 4.2.6.7 | |
| 28548 | + for (const requestResponse of requestResponses) { | |
| 28549 | + const idx = cache.indexOf(requestResponse) | |
| 28550 | + assert(idx !== -1) | |
| 28551 | + | |
| 28552 | + // 4.2.6.7.1 | |
| 28553 | + cache.splice(idx, 1) | |
| 28554 | + } | |
| 28555 | + | |
| 28556 | + // 4.2.6.8 | |
| 28557 | + cache.push([operation.request, operation.response]) | |
| 28558 | + | |
| 28559 | + // 4.2.6.10 | |
| 28560 | + addedItems.push([operation.request, operation.response]) | |
| 28561 | + } | |
| 28562 | + | |
| 28563 | + // 4.2.7 | |
| 28564 | + resultList.push([operation.request, operation.response]) | |
| 28565 | + } | |
| 28566 | + | |
| 28567 | + // 4.3 | |
| 28568 | + return resultList | |
| 28569 | + } catch (e) { // 5. | |
| 28570 | + // 5.1 | |
| 28571 | + this.#relevantRequestResponseList.length = 0 | |
| 28572 | + | |
| 28573 | + // 5.2 | |
| 28574 | + this.#relevantRequestResponseList = backupCache | |
| 28575 | + | |
| 28576 | + // 5.3 | |
| 28577 | + throw e | |
| 28578 | + } | |
| 28579 | + } | |
| 28580 | + | |
| 28581 | + /** | |
| 28582 | + * @see https://w3c.github.io/ServiceWorker/#query-cache | |
| 28583 | + * @param {any} requestQuery | |
| 28584 | + * @param {import('../../types/cache').CacheQueryOptions} options | |
| 28585 | + * @param {requestResponseList} targetStorage | |
| 28586 | + * @returns {requestResponseList} | |
| 28587 | + */ | |
| 28588 | + #queryCache (requestQuery, options, targetStorage) { | |
| 28589 | + /** @type {requestResponseList} */ | |
| 28590 | + const resultList = [] | |
| 28591 | + | |
| 28592 | + const storage = targetStorage ?? this.#relevantRequestResponseList | |
| 28593 | + | |
| 28594 | + for (const requestResponse of storage) { | |
| 28595 | + const [cachedRequest, cachedResponse] = requestResponse | |
| 28596 | + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { | |
| 28597 | + resultList.push(requestResponse) | |
| 28598 | + } | |
| 28599 | + } | |
| 28600 | + | |
| 28601 | + return resultList | |
| 28602 | + } | |
| 28603 | + | |
| 28604 | + /** | |
| 28605 | + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm | |
| 28606 | + * @param {any} requestQuery | |
| 28607 | + * @param {any} request | |
| 28608 | + * @param {any | null} response | |
| 28609 | + * @param {import('../../types/cache').CacheQueryOptions | undefined} options | |
| 28610 | + * @returns {boolean} | |
| 28611 | + */ | |
| 28612 | + #requestMatchesCachedItem (requestQuery, request, response = null, options) { | |
| 28613 | + // if (options?.ignoreMethod === false && request.method === 'GET') { | |
| 28614 | + // return false | |
| 28615 | + // } | |
| 28616 | + | |
| 28617 | + const queryURL = new URL(requestQuery.url) | |
| 28618 | + | |
| 28619 | + const cachedURL = new URL(request.url) | |
| 28620 | + | |
| 28621 | + if (options?.ignoreSearch) { | |
| 28622 | + cachedURL.search = '' | |
| 28623 | + | |
| 28624 | + queryURL.search = '' | |
| 28625 | + } | |
| 28626 | + | |
| 28627 | + if (!urlEquals(queryURL, cachedURL, true)) { | |
| 28628 | + return false | |
| 28629 | + } | |
| 28630 | + | |
| 28631 | + if ( | |
| 28632 | + response == null || | |
| 28633 | + options?.ignoreVary || | |
| 28634 | + !response.headersList.contains('vary') | |
| 28635 | + ) { | |
| 28636 | + return true | |
| 28637 | + } | |
| 28638 | + | |
| 28639 | + const fieldValues = getFieldValues(response.headersList.get('vary')) | |
| 28640 | + | |
| 28641 | + for (const fieldValue of fieldValues) { | |
| 28642 | + if (fieldValue === '*') { | |
| 28643 | + return false | |
| 28644 | + } | |
| 28645 | + | |
| 28646 | + const requestValue = request.headersList.get(fieldValue) | |
| 28647 | + const queryValue = requestQuery.headersList.get(fieldValue) | |
| 28648 | + | |
| 28649 | + // If one has the header and the other doesn't, or one has | |
| 28650 | + // a different value than the other, return false | |
| 28651 | + if (requestValue !== queryValue) { | |
| 28652 | + return false | |
| 28653 | + } | |
| 28654 | + } | |
| 28655 | + | |
| 28656 | + return true | |
| 28657 | + } | |
| 28658 | +} | |
| 28659 | + | |
| 28660 | +Object.defineProperties(Cache.prototype, { | |
| 28661 | + [Symbol.toStringTag]: { | |
| 28662 | + value: 'Cache', | |
| 28663 | + configurable: true | |
| 28664 | + }, | |
| 28665 | + match: kEnumerableProperty, | |
| 28666 | + matchAll: kEnumerableProperty, | |
| 28667 | + add: kEnumerableProperty, | |
| 28668 | + addAll: kEnumerableProperty, | |
| 28669 | + put: kEnumerableProperty, | |
| 28670 | + delete: kEnumerableProperty, | |
| 28671 | + keys: kEnumerableProperty | |
| 28672 | +}) | |
| 28673 | + | |
| 28674 | +const cacheQueryOptionConverters = [ | |
| 28675 | + { | |
| 28676 | + key: 'ignoreSearch', | |
| 28677 | + converter: webidl.converters.boolean, | |
| 28678 | + defaultValue: false | |
| 28679 | + }, | |
| 28680 | + { | |
| 28681 | + key: 'ignoreMethod', | |
| 28682 | + converter: webidl.converters.boolean, | |
| 28683 | + defaultValue: false | |
| 28684 | + }, | |
| 28685 | + { | |
| 28686 | + key: 'ignoreVary', | |
| 28687 | + converter: webidl.converters.boolean, | |
| 28688 | + defaultValue: false | |
| 28689 | + } | |
| 28690 | +] | |
| 28691 | + | |
| 28692 | +webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) | |
| 28693 | + | |
| 28694 | +webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ | |
| 28695 | + ...cacheQueryOptionConverters, | |
| 28696 | + { | |
| 28697 | + key: 'cacheName', | |
| 28698 | + converter: webidl.converters.DOMString | |
| 28699 | + } | |
| 28700 | +]) | |
| 28701 | + | |
| 28702 | +webidl.converters.Response = webidl.interfaceConverter(Response) | |
| 28703 | + | |
| 28704 | +webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter( | |
| 28705 | + webidl.converters.RequestInfo | |
| 28706 | +) | |
| 28707 | + | |
| 28708 | +module.exports = { | |
| 28709 | + Cache | |
| 28710 | +} | |
| 28711 | + | |
| 28712 | + | |
| 28713 | +/***/ }), | |
| 28714 | + | |
| 28715 | +/***/ 4738: | |
| 28716 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 28717 | + | |
| 28718 | +"use strict"; | |
| 28719 | + | |
| 28720 | + | |
| 28721 | +const { kConstruct } = __nccwpck_require__(296) | |
| 28722 | +const { Cache } = __nccwpck_require__(479) | |
| 28723 | +const { webidl } = __nccwpck_require__(4222) | |
| 28724 | +const { kEnumerableProperty } = __nccwpck_require__(3440) | |
| 28725 | + | |
| 28726 | +class CacheStorage { | |
| 28727 | + /** | |
| 28728 | + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map | |
| 28729 | + * @type {Map<string, import('./cache').requestResponseList} | |
| 28730 | + */ | |
| 28731 | + #caches = new Map() | |
| 28732 | + | |
| 28733 | + constructor () { | |
| 28734 | + if (arguments[0] !== kConstruct) { | |
| 28735 | + webidl.illegalConstructor() | |
| 28736 | + } | |
| 28737 | + } | |
| 28738 | + | |
| 28739 | + async match (request, options = {}) { | |
| 28740 | + webidl.brandCheck(this, CacheStorage) | |
| 28741 | + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' }) | |
| 28742 | + | |
| 28743 | + request = webidl.converters.RequestInfo(request) | |
| 28744 | + options = webidl.converters.MultiCacheQueryOptions(options) | |
| 28745 | + | |
| 28746 | + // 1. | |
| 28747 | + if (options.cacheName != null) { | |
| 28748 | + // 1.1.1.1 | |
| 28749 | + if (this.#caches.has(options.cacheName)) { | |
| 28750 | + // 1.1.1.1.1 | |
| 28751 | + const cacheList = this.#caches.get(options.cacheName) | |
| 28752 | + const cache = new Cache(kConstruct, cacheList) | |
| 28753 | + | |
| 28754 | + return await cache.match(request, options) | |
| 28755 | + } | |
| 28756 | + } else { // 2. | |
| 28757 | + // 2.2 | |
| 28758 | + for (const cacheList of this.#caches.values()) { | |
| 28759 | + const cache = new Cache(kConstruct, cacheList) | |
| 28760 | + | |
| 28761 | + // 2.2.1.2 | |
| 28762 | + const response = await cache.match(request, options) | |
| 28763 | + | |
| 28764 | + if (response !== undefined) { | |
| 28765 | + return response | |
| 28766 | + } | |
| 28767 | + } | |
| 28768 | + } | |
| 28769 | + } | |
| 28770 | + | |
| 28771 | + /** | |
| 28772 | + * @see https://w3c.github.io/ServiceWorker/#cache-storage-has | |
| 28773 | + * @param {string} cacheName | |
| 28774 | + * @returns {Promise<boolean>} | |
| 28775 | + */ | |
| 28776 | + async has (cacheName) { | |
| 28777 | + webidl.brandCheck(this, CacheStorage) | |
| 28778 | + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) | |
| 28779 | + | |
| 28780 | + cacheName = webidl.converters.DOMString(cacheName) | |
| 28781 | + | |
| 28782 | + // 2.1.1 | |
| 28783 | + // 2.2 | |
| 28784 | + return this.#caches.has(cacheName) | |
| 28785 | + } | |
| 28786 | + | |
| 28787 | + /** | |
| 28788 | + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open | |
| 28789 | + * @param {string} cacheName | |
| 28790 | + * @returns {Promise<Cache>} | |
| 28791 | + */ | |
| 28792 | + async open (cacheName) { | |
| 28793 | + webidl.brandCheck(this, CacheStorage) | |
| 28794 | + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) | |
| 28795 | + | |
| 28796 | + cacheName = webidl.converters.DOMString(cacheName) | |
| 28797 | + | |
| 28798 | + // 2.1 | |
| 28799 | + if (this.#caches.has(cacheName)) { | |
| 28800 | + // await caches.open('v1') !== await caches.open('v1') | |
| 28801 | + | |
| 28802 | + // 2.1.1 | |
| 28803 | + const cache = this.#caches.get(cacheName) | |
| 28804 | + | |
| 28805 | + // 2.1.1.1 | |
| 28806 | + return new Cache(kConstruct, cache) | |
| 28807 | + } | |
| 28808 | + | |
| 28809 | + // 2.2 | |
| 28810 | + const cache = [] | |
| 28811 | + | |
| 28812 | + // 2.3 | |
| 28813 | + this.#caches.set(cacheName, cache) | |
| 28814 | + | |
| 28815 | + // 2.4 | |
| 28816 | + return new Cache(kConstruct, cache) | |
| 28817 | + } | |
| 28818 | + | |
| 28819 | + /** | |
| 28820 | + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete | |
| 28821 | + * @param {string} cacheName | |
| 28822 | + * @returns {Promise<boolean>} | |
| 28823 | + */ | |
| 28824 | + async delete (cacheName) { | |
| 28825 | + webidl.brandCheck(this, CacheStorage) | |
| 28826 | + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) | |
| 28827 | + | |
| 28828 | + cacheName = webidl.converters.DOMString(cacheName) | |
| 28829 | + | |
| 28830 | + return this.#caches.delete(cacheName) | |
| 28831 | + } | |
| 28832 | + | |
| 28833 | + /** | |
| 28834 | + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys | |
| 28835 | + * @returns {string[]} | |
| 28836 | + */ | |
| 28837 | + async keys () { | |
| 28838 | + webidl.brandCheck(this, CacheStorage) | |
| 28839 | + | |
| 28840 | + // 2.1 | |
| 28841 | + const keys = this.#caches.keys() | |
| 28842 | + | |
| 28843 | + // 2.2 | |
| 28844 | + return [...keys] | |
| 28845 | + } | |
| 28846 | +} | |
| 28847 | + | |
| 28848 | +Object.defineProperties(CacheStorage.prototype, { | |
| 28849 | + [Symbol.toStringTag]: { | |
| 28850 | + value: 'CacheStorage', | |
| 28851 | + configurable: true | |
| 28852 | + }, | |
| 28853 | + match: kEnumerableProperty, | |
| 28854 | + has: kEnumerableProperty, | |
| 28855 | + open: kEnumerableProperty, | |
| 28856 | + delete: kEnumerableProperty, | |
| 28857 | + keys: kEnumerableProperty | |
| 28858 | +}) | |
| 28859 | + | |
| 28860 | +module.exports = { | |
| 28861 | + CacheStorage | |
| 28862 | +} | |
| 28863 | + | |
| 28864 | + | |
| 28865 | +/***/ }), | |
| 28866 | + | |
| 28867 | +/***/ 296: | |
| 28868 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 28869 | + | |
| 28870 | +"use strict"; | |
| 28871 | + | |
| 28872 | + | |
| 28873 | +module.exports = { | |
| 28874 | + kConstruct: (__nccwpck_require__(6443).kConstruct) | |
| 28875 | +} | |
| 28876 | + | |
| 28877 | + | |
| 28878 | +/***/ }), | |
| 28879 | + | |
| 28880 | +/***/ 3993: | |
| 28881 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 28882 | + | |
| 28883 | +"use strict"; | |
| 28884 | + | |
| 28885 | + | |
| 28886 | +const assert = __nccwpck_require__(2613) | |
| 28887 | +const { URLSerializer } = __nccwpck_require__(4322) | |
| 28888 | +const { isValidHeaderName } = __nccwpck_require__(5523) | |
| 28889 | + | |
| 28890 | +/** | |
| 28891 | + * @see https://url.spec.whatwg.org/#concept-url-equals | |
| 28892 | + * @param {URL} A | |
| 28893 | + * @param {URL} B | |
| 28894 | + * @param {boolean | undefined} excludeFragment | |
| 28895 | + * @returns {boolean} | |
| 28896 | + */ | |
| 28897 | +function urlEquals (A, B, excludeFragment = false) { | |
| 28898 | + const serializedA = URLSerializer(A, excludeFragment) | |
| 28899 | + | |
| 28900 | + const serializedB = URLSerializer(B, excludeFragment) | |
| 28901 | + | |
| 28902 | + return serializedA === serializedB | |
| 28903 | +} | |
| 28904 | + | |
| 28905 | +/** | |
| 28906 | + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 | |
| 28907 | + * @param {string} header | |
| 28908 | + */ | |
| 28909 | +function fieldValues (header) { | |
| 28910 | + assert(header !== null) | |
| 28911 | + | |
| 28912 | + const values = [] | |
| 28913 | + | |
| 28914 | + for (let value of header.split(',')) { | |
| 28915 | + value = value.trim() | |
| 28916 | + | |
| 28917 | + if (!value.length) { | |
| 28918 | + continue | |
| 28919 | + } else if (!isValidHeaderName(value)) { | |
| 28920 | + continue | |
| 28921 | + } | |
| 28922 | + | |
| 28923 | + values.push(value) | |
| 28924 | + } | |
| 28925 | + | |
| 28926 | + return values | |
| 28927 | +} | |
| 28928 | + | |
| 28929 | +module.exports = { | |
| 28930 | + urlEquals, | |
| 28931 | + fieldValues | |
| 28932 | +} | |
| 28933 | + | |
| 28934 | + | |
| 28935 | +/***/ }), | |
| 28936 | + | |
| 28937 | +/***/ 6197: | |
| 28938 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 28939 | + | |
| 28940 | +"use strict"; | |
| 28941 | +// @ts-check | |
| 28942 | + | |
| 28943 | + | |
| 28944 | + | |
| 28945 | +/* global WebAssembly */ | |
| 28946 | + | |
| 28947 | +const assert = __nccwpck_require__(2613) | |
| 28948 | +const net = __nccwpck_require__(9278) | |
| 28949 | +const http = __nccwpck_require__(8611) | |
| 28950 | +const { pipeline } = __nccwpck_require__(2203) | |
| 28951 | +const util = __nccwpck_require__(3440) | |
| 28952 | +const timers = __nccwpck_require__(8804) | |
| 28953 | +const Request = __nccwpck_require__(4655) | |
| 28954 | +const DispatcherBase = __nccwpck_require__(1) | |
| 28955 | +const { | |
| 28956 | + RequestContentLengthMismatchError, | |
| 28957 | + ResponseContentLengthMismatchError, | |
| 28958 | + InvalidArgumentError, | |
| 28959 | + RequestAbortedError, | |
| 28960 | + HeadersTimeoutError, | |
| 28961 | + HeadersOverflowError, | |
| 28962 | + SocketError, | |
| 28963 | + InformationalError, | |
| 28964 | + BodyTimeoutError, | |
| 28965 | + HTTPParserError, | |
| 28966 | + ResponseExceededMaxSizeError, | |
| 28967 | + ClientDestroyedError | |
| 28968 | +} = __nccwpck_require__(8707) | |
| 28969 | +const buildConnector = __nccwpck_require__(9136) | |
| 28970 | +const { | |
| 28971 | + kUrl, | |
| 28972 | + kReset, | |
| 28973 | + kServerName, | |
| 28974 | + kClient, | |
| 28975 | + kBusy, | |
| 28976 | + kParser, | |
| 28977 | + kConnect, | |
| 28978 | + kBlocking, | |
| 28979 | + kResuming, | |
| 28980 | + kRunning, | |
| 28981 | + kPending, | |
| 28982 | + kSize, | |
| 28983 | + kWriting, | |
| 28984 | + kQueue, | |
| 28985 | + kConnected, | |
| 28986 | + kConnecting, | |
| 28987 | + kNeedDrain, | |
| 28988 | + kNoRef, | |
| 28989 | + kKeepAliveDefaultTimeout, | |
| 28990 | + kHostHeader, | |
| 28991 | + kPendingIdx, | |
| 28992 | + kRunningIdx, | |
| 28993 | + kError, | |
| 28994 | + kPipelining, | |
| 28995 | + kSocket, | |
| 28996 | + kKeepAliveTimeoutValue, | |
| 28997 | + kMaxHeadersSize, | |
| 28998 | + kKeepAliveMaxTimeout, | |
| 28999 | + kKeepAliveTimeoutThreshold, | |
| 29000 | + kHeadersTimeout, | |
| 29001 | + kBodyTimeout, | |
| 29002 | + kStrictContentLength, | |
| 29003 | + kConnector, | |
| 29004 | + kMaxRedirections, | |
| 29005 | + kMaxRequests, | |
| 29006 | + kCounter, | |
| 29007 | + kClose, | |
| 29008 | + kDestroy, | |
| 29009 | + kDispatch, | |
| 29010 | + kInterceptors, | |
| 29011 | + kLocalAddress, | |
| 29012 | + kMaxResponseSize, | |
| 29013 | + kHTTPConnVersion, | |
| 29014 | + // HTTP2 | |
| 29015 | + kHost, | |
| 29016 | + kHTTP2Session, | |
| 29017 | + kHTTP2SessionState, | |
| 29018 | + kHTTP2BuildRequest, | |
| 29019 | + kHTTP2CopyHeaders, | |
| 29020 | + kHTTP1BuildRequest | |
| 29021 | +} = __nccwpck_require__(6443) | |
| 29022 | + | |
| 29023 | +/** @type {import('http2')} */ | |
| 29024 | +let http2 | |
| 29025 | +try { | |
| 29026 | + http2 = __nccwpck_require__(5675) | |
| 29027 | +} catch { | |
| 29028 | + // @ts-ignore | |
| 29029 | + http2 = { constants: {} } | |
| 29030 | +} | |
| 29031 | + | |
| 29032 | +const { | |
| 29033 | + constants: { | |
| 29034 | + HTTP2_HEADER_AUTHORITY, | |
| 29035 | + HTTP2_HEADER_METHOD, | |
| 29036 | + HTTP2_HEADER_PATH, | |
| 29037 | + HTTP2_HEADER_SCHEME, | |
| 29038 | + HTTP2_HEADER_CONTENT_LENGTH, | |
| 29039 | + HTTP2_HEADER_EXPECT, | |
| 29040 | + HTTP2_HEADER_STATUS | |
| 29041 | + } | |
| 29042 | +} = http2 | |
| 29043 | + | |
| 29044 | +// Experimental | |
| 29045 | +let h2ExperimentalWarned = false | |
| 29046 | + | |
| 29047 | +const FastBuffer = Buffer[Symbol.species] | |
| 29048 | + | |
| 29049 | +const kClosedResolve = Symbol('kClosedResolve') | |
| 29050 | + | |
| 29051 | +const channels = {} | |
| 29052 | + | |
| 29053 | +try { | |
| 29054 | + const diagnosticsChannel = __nccwpck_require__(1637) | |
| 29055 | + channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') | |
| 29056 | + channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') | |
| 29057 | + channels.connectError = diagnosticsChannel.channel('undici:client:connectError') | |
| 29058 | + channels.connected = diagnosticsChannel.channel('undici:client:connected') | |
| 29059 | +} catch { | |
| 29060 | + channels.sendHeaders = { hasSubscribers: false } | |
| 29061 | + channels.beforeConnect = { hasSubscribers: false } | |
| 29062 | + channels.connectError = { hasSubscribers: false } | |
| 29063 | + channels.connected = { hasSubscribers: false } | |
| 29064 | +} | |
| 29065 | + | |
| 29066 | +/** | |
| 29067 | + * @type {import('../types/client').default} | |
| 29068 | + */ | |
| 29069 | +class Client extends DispatcherBase { | |
| 29070 | + /** | |
| 29071 | + * | |
| 29072 | + * @param {string|URL} url | |
| 29073 | + * @param {import('../types/client').Client.Options} options | |
| 29074 | + */ | |
| 29075 | + constructor (url, { | |
| 29076 | + interceptors, | |
| 29077 | + maxHeaderSize, | |
| 29078 | + headersTimeout, | |
| 29079 | + socketTimeout, | |
| 29080 | + requestTimeout, | |
| 29081 | + connectTimeout, | |
| 29082 | + bodyTimeout, | |
| 29083 | + idleTimeout, | |
| 29084 | + keepAlive, | |
| 29085 | + keepAliveTimeout, | |
| 29086 | + maxKeepAliveTimeout, | |
| 29087 | + keepAliveMaxTimeout, | |
| 29088 | + keepAliveTimeoutThreshold, | |
| 29089 | + socketPath, | |
| 29090 | + pipelining, | |
| 29091 | + tls, | |
| 29092 | + strictContentLength, | |
| 29093 | + maxCachedSessions, | |
| 29094 | + maxRedirections, | |
| 29095 | + connect, | |
| 29096 | + maxRequestsPerClient, | |
| 29097 | + localAddress, | |
| 29098 | + maxResponseSize, | |
| 29099 | + autoSelectFamily, | |
| 29100 | + autoSelectFamilyAttemptTimeout, | |
| 29101 | + // h2 | |
| 29102 | + allowH2, | |
| 29103 | + maxConcurrentStreams | |
| 29104 | + } = {}) { | |
| 29105 | + super() | |
| 29106 | + | |
| 29107 | + if (keepAlive !== undefined) { | |
| 29108 | + throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') | |
| 29109 | + } | |
| 29110 | + | |
| 29111 | + if (socketTimeout !== undefined) { | |
| 29112 | + throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') | |
| 29113 | + } | |
| 29114 | + | |
| 29115 | + if (requestTimeout !== undefined) { | |
| 29116 | + throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') | |
| 29117 | + } | |
| 29118 | + | |
| 29119 | + if (idleTimeout !== undefined) { | |
| 29120 | + throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') | |
| 29121 | + } | |
| 29122 | + | |
| 29123 | + if (maxKeepAliveTimeout !== undefined) { | |
| 29124 | + throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') | |
| 29125 | + } | |
| 29126 | + | |
| 29127 | + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { | |
| 29128 | + throw new InvalidArgumentError('invalid maxHeaderSize') | |
| 29129 | + } | |
| 29130 | + | |
| 29131 | + if (socketPath != null && typeof socketPath !== 'string') { | |
| 29132 | + throw new InvalidArgumentError('invalid socketPath') | |
| 29133 | + } | |
| 29134 | + | |
| 29135 | + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { | |
| 29136 | + throw new InvalidArgumentError('invalid connectTimeout') | |
| 29137 | + } | |
| 29138 | + | |
| 29139 | + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { | |
| 29140 | + throw new InvalidArgumentError('invalid keepAliveTimeout') | |
| 29141 | + } | |
| 29142 | + | |
| 29143 | + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { | |
| 29144 | + throw new InvalidArgumentError('invalid keepAliveMaxTimeout') | |
| 29145 | + } | |
| 29146 | + | |
| 29147 | + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { | |
| 29148 | + throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') | |
| 29149 | + } | |
| 29150 | + | |
| 29151 | + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { | |
| 29152 | + throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') | |
| 29153 | + } | |
| 29154 | + | |
| 29155 | + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { | |
| 29156 | + throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') | |
| 29157 | + } | |
| 29158 | + | |
| 29159 | + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { | |
| 29160 | + throw new InvalidArgumentError('connect must be a function or an object') | |
| 29161 | + } | |
| 29162 | + | |
| 29163 | + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { | |
| 29164 | + throw new InvalidArgumentError('maxRedirections must be a positive number') | |
| 29165 | + } | |
| 29166 | + | |
| 29167 | + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { | |
| 29168 | + throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') | |
| 29169 | + } | |
| 29170 | + | |
| 29171 | + if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { | |
| 29172 | + throw new InvalidArgumentError('localAddress must be valid string IP address') | |
| 29173 | + } | |
| 29174 | + | |
| 29175 | + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { | |
| 29176 | + throw new InvalidArgumentError('maxResponseSize must be a positive number') | |
| 29177 | + } | |
| 29178 | + | |
| 29179 | + if ( | |
| 29180 | + autoSelectFamilyAttemptTimeout != null && | |
| 29181 | + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) | |
| 29182 | + ) { | |
| 29183 | + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') | |
| 29184 | + } | |
| 29185 | + | |
| 29186 | + // h2 | |
| 29187 | + if (allowH2 != null && typeof allowH2 !== 'boolean') { | |
| 29188 | + throw new InvalidArgumentError('allowH2 must be a valid boolean value') | |
| 29189 | + } | |
| 29190 | + | |
| 29191 | + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { | |
| 29192 | + throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') | |
| 29193 | + } | |
| 29194 | + | |
| 29195 | + if (typeof connect !== 'function') { | |
| 29196 | + connect = buildConnector({ | |
| 29197 | + ...tls, | |
| 29198 | + maxCachedSessions, | |
| 29199 | + allowH2, | |
| 29200 | + socketPath, | |
| 29201 | + timeout: connectTimeout, | |
| 29202 | + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), | |
| 29203 | + ...connect | |
| 29204 | + }) | |
| 29205 | + } | |
| 29206 | + | |
| 29207 | + this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) | |
| 29208 | + ? interceptors.Client | |
| 29209 | + : [createRedirectInterceptor({ maxRedirections })] | |
| 29210 | + this[kUrl] = util.parseOrigin(url) | |
| 29211 | + this[kConnector] = connect | |
| 29212 | + this[kSocket] = null | |
| 29213 | + this[kPipelining] = pipelining != null ? pipelining : 1 | |
| 29214 | + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize | |
| 29215 | + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout | |
| 29216 | + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout | |
| 29217 | + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold | |
| 29218 | + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] | |
| 29219 | + this[kServerName] = null | |
| 29220 | + this[kLocalAddress] = localAddress != null ? localAddress : null | |
| 29221 | + this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming | |
| 29222 | + this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming | |
| 29223 | + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` | |
| 29224 | + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 | |
| 29225 | + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 | |
| 29226 | + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength | |
| 29227 | + this[kMaxRedirections] = maxRedirections | |
| 29228 | + this[kMaxRequests] = maxRequestsPerClient | |
| 29229 | + this[kClosedResolve] = null | |
| 29230 | + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 | |
| 29231 | + this[kHTTPConnVersion] = 'h1' | |
| 29232 | + | |
| 29233 | + // HTTP/2 | |
| 29234 | + this[kHTTP2Session] = null | |
| 29235 | + this[kHTTP2SessionState] = !allowH2 | |
| 29236 | + ? null | |
| 29237 | + : { | |
| 29238 | + // streams: null, // Fixed queue of streams - For future support of `push` | |
| 29239 | + openStreams: 0, // Keep track of them to decide wether or not unref the session | |
| 29240 | + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server | |
| 29241 | + } | |
| 29242 | + this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` | |
| 29243 | + | |
| 29244 | + // kQueue is built up of 3 sections separated by | |
| 29245 | + // the kRunningIdx and kPendingIdx indices. | |
| 29246 | + // | complete | running | pending | | |
| 29247 | + // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length | |
| 29248 | + // kRunningIdx points to the first running element. | |
| 29249 | + // kPendingIdx points to the first pending element. | |
| 29250 | + // This implements a fast queue with an amortized | |
| 29251 | + // time of O(1). | |
| 29252 | + | |
| 29253 | + this[kQueue] = [] | |
| 29254 | + this[kRunningIdx] = 0 | |
| 29255 | + this[kPendingIdx] = 0 | |
| 29256 | + } | |
| 29257 | + | |
| 29258 | + get pipelining () { | |
| 29259 | + return this[kPipelining] | |
| 29260 | + } | |
| 29261 | + | |
| 29262 | + set pipelining (value) { | |
| 29263 | + this[kPipelining] = value | |
| 29264 | + resume(this, true) | |
| 29265 | + } | |
| 29266 | + | |
| 29267 | + get [kPending] () { | |
| 29268 | + return this[kQueue].length - this[kPendingIdx] | |
| 29269 | + } | |
| 29270 | + | |
| 29271 | + get [kRunning] () { | |
| 29272 | + return this[kPendingIdx] - this[kRunningIdx] | |
| 29273 | + } | |
| 29274 | + | |
| 29275 | + get [kSize] () { | |
| 29276 | + return this[kQueue].length - this[kRunningIdx] | |
| 29277 | + } | |
| 29278 | + | |
| 29279 | + get [kConnected] () { | |
| 29280 | + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed | |
| 29281 | + } | |
| 29282 | + | |
| 29283 | + get [kBusy] () { | |
| 29284 | + const socket = this[kSocket] | |
| 29285 | + return ( | |
| 29286 | + (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || | |
| 29287 | + (this[kSize] >= (this[kPipelining] || 1)) || | |
| 29288 | + this[kPending] > 0 | |
| 29289 | + ) | |
| 29290 | + } | |
| 29291 | + | |
| 29292 | + /* istanbul ignore: only used for test */ | |
| 29293 | + [kConnect] (cb) { | |
| 29294 | + connect(this) | |
| 29295 | + this.once('connect', cb) | |
| 29296 | + } | |
| 29297 | + | |
| 29298 | + [kDispatch] (opts, handler) { | |
| 29299 | + const origin = opts.origin || this[kUrl].origin | |
| 29300 | + | |
| 29301 | + const request = this[kHTTPConnVersion] === 'h2' | |
| 29302 | + ? Request[kHTTP2BuildRequest](origin, opts, handler) | |
| 29303 | + : Request[kHTTP1BuildRequest](origin, opts, handler) | |
| 29304 | + | |
| 29305 | + this[kQueue].push(request) | |
| 29306 | + if (this[kResuming]) { | |
| 29307 | + // Do nothing. | |
| 29308 | + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { | |
| 29309 | + // Wait a tick in case stream/iterator is ended in the same tick. | |
| 29310 | + this[kResuming] = 1 | |
| 29311 | + process.nextTick(resume, this) | |
| 29312 | + } else { | |
| 29313 | + resume(this, true) | |
| 29314 | + } | |
| 29315 | + | |
| 29316 | + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { | |
| 29317 | + this[kNeedDrain] = 2 | |
| 29318 | + } | |
| 29319 | + | |
| 29320 | + return this[kNeedDrain] < 2 | |
| 29321 | + } | |
| 29322 | + | |
| 29323 | + async [kClose] () { | |
| 29324 | + // TODO: for H2 we need to gracefully flush the remaining enqueued | |
| 29325 | + // request and close each stream. | |
| 29326 | + return new Promise((resolve) => { | |
| 29327 | + if (!this[kSize]) { | |
| 29328 | + resolve(null) | |
| 29329 | + } else { | |
| 29330 | + this[kClosedResolve] = resolve | |
| 29331 | + } | |
| 29332 | + }) | |
| 29333 | + } | |
| 29334 | + | |
| 29335 | + async [kDestroy] (err) { | |
| 29336 | + return new Promise((resolve) => { | |
| 29337 | + const requests = this[kQueue].splice(this[kPendingIdx]) | |
| 29338 | + for (let i = 0; i < requests.length; i++) { | |
| 29339 | + const request = requests[i] | |
| 29340 | + errorRequest(this, request, err) | |
| 29341 | + } | |
| 29342 | + | |
| 29343 | + const callback = () => { | |
| 29344 | + if (this[kClosedResolve]) { | |
| 29345 | + // TODO (fix): Should we error here with ClientDestroyedError? | |
| 29346 | + this[kClosedResolve]() | |
| 29347 | + this[kClosedResolve] = null | |
| 29348 | + } | |
| 29349 | + resolve() | |
| 29350 | + } | |
| 29351 | + | |
| 29352 | + if (this[kHTTP2Session] != null) { | |
| 29353 | + util.destroy(this[kHTTP2Session], err) | |
| 29354 | + this[kHTTP2Session] = null | |
| 29355 | + this[kHTTP2SessionState] = null | |
| 29356 | + } | |
| 29357 | + | |
| 29358 | + if (!this[kSocket]) { | |
| 29359 | + queueMicrotask(callback) | |
| 29360 | + } else { | |
| 29361 | + util.destroy(this[kSocket].on('close', callback), err) | |
| 29362 | + } | |
| 29363 | + | |
| 29364 | + resume(this) | |
| 29365 | + }) | |
| 29366 | + } | |
| 29367 | +} | |
| 29368 | + | |
| 29369 | +function onHttp2SessionError (err) { | |
| 29370 | + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') | |
| 29371 | + | |
| 29372 | + this[kSocket][kError] = err | |
| 29373 | + | |
| 29374 | + onError(this[kClient], err) | |
| 29375 | +} | |
| 29376 | + | |
| 29377 | +function onHttp2FrameError (type, code, id) { | |
| 29378 | + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) | |
| 29379 | + | |
| 29380 | + if (id === 0) { | |
| 29381 | + this[kSocket][kError] = err | |
| 29382 | + onError(this[kClient], err) | |
| 29383 | + } | |
| 29384 | +} | |
| 29385 | + | |
| 29386 | +function onHttp2SessionEnd () { | |
| 29387 | + util.destroy(this, new SocketError('other side closed')) | |
| 29388 | + util.destroy(this[kSocket], new SocketError('other side closed')) | |
| 29389 | +} | |
| 29390 | + | |
| 29391 | +function onHTTP2GoAway (code) { | |
| 29392 | + const client = this[kClient] | |
| 29393 | + const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) | |
| 29394 | + client[kSocket] = null | |
| 29395 | + client[kHTTP2Session] = null | |
| 29396 | + | |
| 29397 | + if (client.destroyed) { | |
| 29398 | + assert(this[kPending] === 0) | |
| 29399 | + | |
| 29400 | + // Fail entire queue. | |
| 29401 | + const requests = client[kQueue].splice(client[kRunningIdx]) | |
| 29402 | + for (let i = 0; i < requests.length; i++) { | |
| 29403 | + const request = requests[i] | |
| 29404 | + errorRequest(this, request, err) | |
| 29405 | + } | |
| 29406 | + } else if (client[kRunning] > 0) { | |
| 29407 | + // Fail head of pipeline. | |
| 29408 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29409 | + client[kQueue][client[kRunningIdx]++] = null | |
| 29410 | + | |
| 29411 | + errorRequest(client, request, err) | |
| 29412 | + } | |
| 29413 | + | |
| 29414 | + client[kPendingIdx] = client[kRunningIdx] | |
| 29415 | + | |
| 29416 | + assert(client[kRunning] === 0) | |
| 29417 | + | |
| 29418 | + client.emit('disconnect', | |
| 29419 | + client[kUrl], | |
| 29420 | + [client], | |
| 29421 | + err | |
| 29422 | + ) | |
| 29423 | + | |
| 29424 | + resume(client) | |
| 29425 | +} | |
| 29426 | + | |
| 29427 | +const constants = __nccwpck_require__(2824) | |
| 29428 | +const createRedirectInterceptor = __nccwpck_require__(4415) | |
| 29429 | +const EMPTY_BUF = Buffer.alloc(0) | |
| 29430 | + | |
| 29431 | +async function lazyllhttp () { | |
| 29432 | + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(3870) : undefined | |
| 29433 | + | |
| 29434 | + let mod | |
| 29435 | + try { | |
| 29436 | + mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(3434), 'base64')) | |
| 29437 | + } catch (e) { | |
| 29438 | + /* istanbul ignore next */ | |
| 29439 | + | |
| 29440 | + // We could check if the error was caused by the simd option not | |
| 29441 | + // being enabled, but the occurring of this other error | |
| 29442 | + // * https://github.com/emscripten-core/emscripten/issues/11495 | |
| 29443 | + // got me to remove that check to avoid breaking Node 12. | |
| 29444 | + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(3870), 'base64')) | |
| 29445 | + } | |
| 29446 | + | |
| 29447 | + return await WebAssembly.instantiate(mod, { | |
| 29448 | + env: { | |
| 29449 | + /* eslint-disable camelcase */ | |
| 29450 | + | |
| 29451 | + wasm_on_url: (p, at, len) => { | |
| 29452 | + /* istanbul ignore next */ | |
| 29453 | + return 0 | |
| 29454 | + }, | |
| 29455 | + wasm_on_status: (p, at, len) => { | |
| 29456 | + assert.strictEqual(currentParser.ptr, p) | |
| 29457 | + const start = at - currentBufferPtr + currentBufferRef.byteOffset | |
| 29458 | + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 | |
| 29459 | + }, | |
| 29460 | + wasm_on_message_begin: (p) => { | |
| 29461 | + assert.strictEqual(currentParser.ptr, p) | |
| 29462 | + return currentParser.onMessageBegin() || 0 | |
| 29463 | + }, | |
| 29464 | + wasm_on_header_field: (p, at, len) => { | |
| 29465 | + assert.strictEqual(currentParser.ptr, p) | |
| 29466 | + const start = at - currentBufferPtr + currentBufferRef.byteOffset | |
| 29467 | + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 | |
| 29468 | + }, | |
| 29469 | + wasm_on_header_value: (p, at, len) => { | |
| 29470 | + assert.strictEqual(currentParser.ptr, p) | |
| 29471 | + const start = at - currentBufferPtr + currentBufferRef.byteOffset | |
| 29472 | + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 | |
| 29473 | + }, | |
| 29474 | + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { | |
| 29475 | + assert.strictEqual(currentParser.ptr, p) | |
| 29476 | + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 | |
| 29477 | + }, | |
| 29478 | + wasm_on_body: (p, at, len) => { | |
| 29479 | + assert.strictEqual(currentParser.ptr, p) | |
| 29480 | + const start = at - currentBufferPtr + currentBufferRef.byteOffset | |
| 29481 | + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 | |
| 29482 | + }, | |
| 29483 | + wasm_on_message_complete: (p) => { | |
| 29484 | + assert.strictEqual(currentParser.ptr, p) | |
| 29485 | + return currentParser.onMessageComplete() || 0 | |
| 29486 | + } | |
| 29487 | + | |
| 29488 | + /* eslint-enable camelcase */ | |
| 29489 | + } | |
| 29490 | + }) | |
| 29491 | +} | |
| 29492 | + | |
| 29493 | +let llhttpInstance = null | |
| 29494 | +let llhttpPromise = lazyllhttp() | |
| 29495 | +llhttpPromise.catch() | |
| 29496 | + | |
| 29497 | +let currentParser = null | |
| 29498 | +let currentBufferRef = null | |
| 29499 | +let currentBufferSize = 0 | |
| 29500 | +let currentBufferPtr = null | |
| 29501 | + | |
| 29502 | +const TIMEOUT_HEADERS = 1 | |
| 29503 | +const TIMEOUT_BODY = 2 | |
| 29504 | +const TIMEOUT_IDLE = 3 | |
| 29505 | + | |
| 29506 | +class Parser { | |
| 29507 | + constructor (client, socket, { exports }) { | |
| 29508 | + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) | |
| 29509 | + | |
| 29510 | + this.llhttp = exports | |
| 29511 | + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) | |
| 29512 | + this.client = client | |
| 29513 | + this.socket = socket | |
| 29514 | + this.timeout = null | |
| 29515 | + this.timeoutValue = null | |
| 29516 | + this.timeoutType = null | |
| 29517 | + this.statusCode = null | |
| 29518 | + this.statusText = '' | |
| 29519 | + this.upgrade = false | |
| 29520 | + this.headers = [] | |
| 29521 | + this.headersSize = 0 | |
| 29522 | + this.headersMaxSize = client[kMaxHeadersSize] | |
| 29523 | + this.shouldKeepAlive = false | |
| 29524 | + this.paused = false | |
| 29525 | + this.resume = this.resume.bind(this) | |
| 29526 | + | |
| 29527 | + this.bytesRead = 0 | |
| 29528 | + | |
| 29529 | + this.keepAlive = '' | |
| 29530 | + this.contentLength = '' | |
| 29531 | + this.connection = '' | |
| 29532 | + this.maxResponseSize = client[kMaxResponseSize] | |
| 29533 | + } | |
| 29534 | + | |
| 29535 | + setTimeout (value, type) { | |
| 29536 | + this.timeoutType = type | |
| 29537 | + if (value !== this.timeoutValue) { | |
| 29538 | + timers.clearTimeout(this.timeout) | |
| 29539 | + if (value) { | |
| 29540 | + this.timeout = timers.setTimeout(onParserTimeout, value, this) | |
| 29541 | + // istanbul ignore else: only for jest | |
| 29542 | + if (this.timeout.unref) { | |
| 29543 | + this.timeout.unref() | |
| 29544 | + } | |
| 29545 | + } else { | |
| 29546 | + this.timeout = null | |
| 29547 | + } | |
| 29548 | + this.timeoutValue = value | |
| 29549 | + } else if (this.timeout) { | |
| 29550 | + // istanbul ignore else: only for jest | |
| 29551 | + if (this.timeout.refresh) { | |
| 29552 | + this.timeout.refresh() | |
| 29553 | + } | |
| 29554 | + } | |
| 29555 | + } | |
| 29556 | + | |
| 29557 | + resume () { | |
| 29558 | + if (this.socket.destroyed || !this.paused) { | |
| 29559 | + return | |
| 29560 | + } | |
| 29561 | + | |
| 29562 | + assert(this.ptr != null) | |
| 29563 | + assert(currentParser == null) | |
| 29564 | + | |
| 29565 | + this.llhttp.llhttp_resume(this.ptr) | |
| 29566 | + | |
| 29567 | + assert(this.timeoutType === TIMEOUT_BODY) | |
| 29568 | + if (this.timeout) { | |
| 29569 | + // istanbul ignore else: only for jest | |
| 29570 | + if (this.timeout.refresh) { | |
| 29571 | + this.timeout.refresh() | |
| 29572 | + } | |
| 29573 | + } | |
| 29574 | + | |
| 29575 | + this.paused = false | |
| 29576 | + this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. | |
| 29577 | + this.readMore() | |
| 29578 | + } | |
| 29579 | + | |
| 29580 | + readMore () { | |
| 29581 | + while (!this.paused && this.ptr) { | |
| 29582 | + const chunk = this.socket.read() | |
| 29583 | + if (chunk === null) { | |
| 29584 | + break | |
| 29585 | + } | |
| 29586 | + this.execute(chunk) | |
| 29587 | + } | |
| 29588 | + } | |
| 29589 | + | |
| 29590 | + execute (data) { | |
| 29591 | + assert(this.ptr != null) | |
| 29592 | + assert(currentParser == null) | |
| 29593 | + assert(!this.paused) | |
| 29594 | + | |
| 29595 | + const { socket, llhttp } = this | |
| 29596 | + | |
| 29597 | + if (data.length > currentBufferSize) { | |
| 29598 | + if (currentBufferPtr) { | |
| 29599 | + llhttp.free(currentBufferPtr) | |
| 29600 | + } | |
| 29601 | + currentBufferSize = Math.ceil(data.length / 4096) * 4096 | |
| 29602 | + currentBufferPtr = llhttp.malloc(currentBufferSize) | |
| 29603 | + } | |
| 29604 | + | |
| 29605 | + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) | |
| 29606 | + | |
| 29607 | + // Call `execute` on the wasm parser. | |
| 29608 | + // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, | |
| 29609 | + // and finally the length of bytes to parse. | |
| 29610 | + // The return value is an error code or `constants.ERROR.OK`. | |
| 29611 | + try { | |
| 29612 | + let ret | |
| 29613 | + | |
| 29614 | + try { | |
| 29615 | + currentBufferRef = data | |
| 29616 | + currentParser = this | |
| 29617 | + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) | |
| 29618 | + /* eslint-disable-next-line no-useless-catch */ | |
| 29619 | + } catch (err) { | |
| 29620 | + /* istanbul ignore next: difficult to make a test case for */ | |
| 29621 | + throw err | |
| 29622 | + } finally { | |
| 29623 | + currentParser = null | |
| 29624 | + currentBufferRef = null | |
| 29625 | + } | |
| 29626 | + | |
| 29627 | + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr | |
| 29628 | + | |
| 29629 | + if (ret === constants.ERROR.PAUSED_UPGRADE) { | |
| 29630 | + this.onUpgrade(data.slice(offset)) | |
| 29631 | + } else if (ret === constants.ERROR.PAUSED) { | |
| 29632 | + this.paused = true | |
| 29633 | + socket.unshift(data.slice(offset)) | |
| 29634 | + } else if (ret !== constants.ERROR.OK) { | |
| 29635 | + const ptr = llhttp.llhttp_get_error_reason(this.ptr) | |
| 29636 | + let message = '' | |
| 29637 | + /* istanbul ignore else: difficult to make a test case for */ | |
| 29638 | + if (ptr) { | |
| 29639 | + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) | |
| 29640 | + message = | |
| 29641 | + 'Response does not match the HTTP/1.1 protocol (' + | |
| 29642 | + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + | |
| 29643 | + ')' | |
| 29644 | + } | |
| 29645 | + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) | |
| 29646 | + } | |
| 29647 | + } catch (err) { | |
| 29648 | + util.destroy(socket, err) | |
| 29649 | + } | |
| 29650 | + } | |
| 29651 | + | |
| 29652 | + destroy () { | |
| 29653 | + assert(this.ptr != null) | |
| 29654 | + assert(currentParser == null) | |
| 29655 | + | |
| 29656 | + this.llhttp.llhttp_free(this.ptr) | |
| 29657 | + this.ptr = null | |
| 29658 | + | |
| 29659 | + timers.clearTimeout(this.timeout) | |
| 29660 | + this.timeout = null | |
| 29661 | + this.timeoutValue = null | |
| 29662 | + this.timeoutType = null | |
| 29663 | + | |
| 29664 | + this.paused = false | |
| 29665 | + } | |
| 29666 | + | |
| 29667 | + onStatus (buf) { | |
| 29668 | + this.statusText = buf.toString() | |
| 29669 | + } | |
| 29670 | + | |
| 29671 | + onMessageBegin () { | |
| 29672 | + const { socket, client } = this | |
| 29673 | + | |
| 29674 | + /* istanbul ignore next: difficult to make a test case for */ | |
| 29675 | + if (socket.destroyed) { | |
| 29676 | + return -1 | |
| 29677 | + } | |
| 29678 | + | |
| 29679 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29680 | + if (!request) { | |
| 29681 | + return -1 | |
| 29682 | + } | |
| 29683 | + } | |
| 29684 | + | |
| 29685 | + onHeaderField (buf) { | |
| 29686 | + const len = this.headers.length | |
| 29687 | + | |
| 29688 | + if ((len & 1) === 0) { | |
| 29689 | + this.headers.push(buf) | |
| 29690 | + } else { | |
| 29691 | + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) | |
| 29692 | + } | |
| 29693 | + | |
| 29694 | + this.trackHeader(buf.length) | |
| 29695 | + } | |
| 29696 | + | |
| 29697 | + onHeaderValue (buf) { | |
| 29698 | + let len = this.headers.length | |
| 29699 | + | |
| 29700 | + if ((len & 1) === 1) { | |
| 29701 | + this.headers.push(buf) | |
| 29702 | + len += 1 | |
| 29703 | + } else { | |
| 29704 | + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) | |
| 29705 | + } | |
| 29706 | + | |
| 29707 | + const key = this.headers[len - 2] | |
| 29708 | + if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { | |
| 29709 | + this.keepAlive += buf.toString() | |
| 29710 | + } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { | |
| 29711 | + this.connection += buf.toString() | |
| 29712 | + } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { | |
| 29713 | + this.contentLength += buf.toString() | |
| 29714 | + } | |
| 29715 | + | |
| 29716 | + this.trackHeader(buf.length) | |
| 29717 | + } | |
| 29718 | + | |
| 29719 | + trackHeader (len) { | |
| 29720 | + this.headersSize += len | |
| 29721 | + if (this.headersSize >= this.headersMaxSize) { | |
| 29722 | + util.destroy(this.socket, new HeadersOverflowError()) | |
| 29723 | + } | |
| 29724 | + } | |
| 29725 | + | |
| 29726 | + onUpgrade (head) { | |
| 29727 | + const { upgrade, client, socket, headers, statusCode } = this | |
| 29728 | + | |
| 29729 | + assert(upgrade) | |
| 29730 | + | |
| 29731 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29732 | + assert(request) | |
| 29733 | + | |
| 29734 | + assert(!socket.destroyed) | |
| 29735 | + assert(socket === client[kSocket]) | |
| 29736 | + assert(!this.paused) | |
| 29737 | + assert(request.upgrade || request.method === 'CONNECT') | |
| 29738 | + | |
| 29739 | + this.statusCode = null | |
| 29740 | + this.statusText = '' | |
| 29741 | + this.shouldKeepAlive = null | |
| 29742 | + | |
| 29743 | + assert(this.headers.length % 2 === 0) | |
| 29744 | + this.headers = [] | |
| 29745 | + this.headersSize = 0 | |
| 29746 | + | |
| 29747 | + socket.unshift(head) | |
| 29748 | + | |
| 29749 | + socket[kParser].destroy() | |
| 29750 | + socket[kParser] = null | |
| 29751 | + | |
| 29752 | + socket[kClient] = null | |
| 29753 | + socket[kError] = null | |
| 29754 | + socket | |
| 29755 | + .removeListener('error', onSocketError) | |
| 29756 | + .removeListener('readable', onSocketReadable) | |
| 29757 | + .removeListener('end', onSocketEnd) | |
| 29758 | + .removeListener('close', onSocketClose) | |
| 29759 | + | |
| 29760 | + client[kSocket] = null | |
| 29761 | + client[kQueue][client[kRunningIdx]++] = null | |
| 29762 | + client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) | |
| 29763 | + | |
| 29764 | + try { | |
| 29765 | + request.onUpgrade(statusCode, headers, socket) | |
| 29766 | + } catch (err) { | |
| 29767 | + util.destroy(socket, err) | |
| 29768 | + } | |
| 29769 | + | |
| 29770 | + resume(client) | |
| 29771 | + } | |
| 29772 | + | |
| 29773 | + onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { | |
| 29774 | + const { client, socket, headers, statusText } = this | |
| 29775 | + | |
| 29776 | + /* istanbul ignore next: difficult to make a test case for */ | |
| 29777 | + if (socket.destroyed) { | |
| 29778 | + return -1 | |
| 29779 | + } | |
| 29780 | + | |
| 29781 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29782 | + | |
| 29783 | + /* istanbul ignore next: difficult to make a test case for */ | |
| 29784 | + if (!request) { | |
| 29785 | + return -1 | |
| 29786 | + } | |
| 29787 | + | |
| 29788 | + assert(!this.upgrade) | |
| 29789 | + assert(this.statusCode < 200) | |
| 29790 | + | |
| 29791 | + if (statusCode === 100) { | |
| 29792 | + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) | |
| 29793 | + return -1 | |
| 29794 | + } | |
| 29795 | + | |
| 29796 | + /* this can only happen if server is misbehaving */ | |
| 29797 | + if (upgrade && !request.upgrade) { | |
| 29798 | + util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) | |
| 29799 | + return -1 | |
| 29800 | + } | |
| 29801 | + | |
| 29802 | + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) | |
| 29803 | + | |
| 29804 | + this.statusCode = statusCode | |
| 29805 | + this.shouldKeepAlive = ( | |
| 29806 | + shouldKeepAlive || | |
| 29807 | + // Override llhttp value which does not allow keepAlive for HEAD. | |
| 29808 | + (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') | |
| 29809 | + ) | |
| 29810 | + | |
| 29811 | + if (this.statusCode >= 200) { | |
| 29812 | + const bodyTimeout = request.bodyTimeout != null | |
| 29813 | + ? request.bodyTimeout | |
| 29814 | + : client[kBodyTimeout] | |
| 29815 | + this.setTimeout(bodyTimeout, TIMEOUT_BODY) | |
| 29816 | + } else if (this.timeout) { | |
| 29817 | + // istanbul ignore else: only for jest | |
| 29818 | + if (this.timeout.refresh) { | |
| 29819 | + this.timeout.refresh() | |
| 29820 | + } | |
| 29821 | + } | |
| 29822 | + | |
| 29823 | + if (request.method === 'CONNECT') { | |
| 29824 | + assert(client[kRunning] === 1) | |
| 29825 | + this.upgrade = true | |
| 29826 | + return 2 | |
| 29827 | + } | |
| 29828 | + | |
| 29829 | + if (upgrade) { | |
| 29830 | + assert(client[kRunning] === 1) | |
| 29831 | + this.upgrade = true | |
| 29832 | + return 2 | |
| 29833 | + } | |
| 29834 | + | |
| 29835 | + assert(this.headers.length % 2 === 0) | |
| 29836 | + this.headers = [] | |
| 29837 | + this.headersSize = 0 | |
| 29838 | + | |
| 29839 | + if (this.shouldKeepAlive && client[kPipelining]) { | |
| 29840 | + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null | |
| 29841 | + | |
| 29842 | + if (keepAliveTimeout != null) { | |
| 29843 | + const timeout = Math.min( | |
| 29844 | + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], | |
| 29845 | + client[kKeepAliveMaxTimeout] | |
| 29846 | + ) | |
| 29847 | + if (timeout <= 0) { | |
| 29848 | + socket[kReset] = true | |
| 29849 | + } else { | |
| 29850 | + client[kKeepAliveTimeoutValue] = timeout | |
| 29851 | + } | |
| 29852 | + } else { | |
| 29853 | + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] | |
| 29854 | + } | |
| 29855 | + } else { | |
| 29856 | + // Stop more requests from being dispatched. | |
| 29857 | + socket[kReset] = true | |
| 29858 | + } | |
| 29859 | + | |
| 29860 | + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false | |
| 29861 | + | |
| 29862 | + if (request.aborted) { | |
| 29863 | + return -1 | |
| 29864 | + } | |
| 29865 | + | |
| 29866 | + if (request.method === 'HEAD') { | |
| 29867 | + return 1 | |
| 29868 | + } | |
| 29869 | + | |
| 29870 | + if (statusCode < 200) { | |
| 29871 | + return 1 | |
| 29872 | + } | |
| 29873 | + | |
| 29874 | + if (socket[kBlocking]) { | |
| 29875 | + socket[kBlocking] = false | |
| 29876 | + resume(client) | |
| 29877 | + } | |
| 29878 | + | |
| 29879 | + return pause ? constants.ERROR.PAUSED : 0 | |
| 29880 | + } | |
| 29881 | + | |
| 29882 | + onBody (buf) { | |
| 29883 | + const { client, socket, statusCode, maxResponseSize } = this | |
| 29884 | + | |
| 29885 | + if (socket.destroyed) { | |
| 29886 | + return -1 | |
| 29887 | + } | |
| 29888 | + | |
| 29889 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29890 | + assert(request) | |
| 29891 | + | |
| 29892 | + assert.strictEqual(this.timeoutType, TIMEOUT_BODY) | |
| 29893 | + if (this.timeout) { | |
| 29894 | + // istanbul ignore else: only for jest | |
| 29895 | + if (this.timeout.refresh) { | |
| 29896 | + this.timeout.refresh() | |
| 29897 | + } | |
| 29898 | + } | |
| 29899 | + | |
| 29900 | + assert(statusCode >= 200) | |
| 29901 | + | |
| 29902 | + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { | |
| 29903 | + util.destroy(socket, new ResponseExceededMaxSizeError()) | |
| 29904 | + return -1 | |
| 29905 | + } | |
| 29906 | + | |
| 29907 | + this.bytesRead += buf.length | |
| 29908 | + | |
| 29909 | + if (request.onData(buf) === false) { | |
| 29910 | + return constants.ERROR.PAUSED | |
| 29911 | + } | |
| 29912 | + } | |
| 29913 | + | |
| 29914 | + onMessageComplete () { | |
| 29915 | + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this | |
| 29916 | + | |
| 29917 | + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { | |
| 29918 | + return -1 | |
| 29919 | + } | |
| 29920 | + | |
| 29921 | + if (upgrade) { | |
| 29922 | + return | |
| 29923 | + } | |
| 29924 | + | |
| 29925 | + const request = client[kQueue][client[kRunningIdx]] | |
| 29926 | + assert(request) | |
| 29927 | + | |
| 29928 | + assert(statusCode >= 100) | |
| 29929 | + | |
| 29930 | + this.statusCode = null | |
| 29931 | + this.statusText = '' | |
| 29932 | + this.bytesRead = 0 | |
| 29933 | + this.contentLength = '' | |
| 29934 | + this.keepAlive = '' | |
| 29935 | + this.connection = '' | |
| 29936 | + | |
| 29937 | + assert(this.headers.length % 2 === 0) | |
| 29938 | + this.headers = [] | |
| 29939 | + this.headersSize = 0 | |
| 29940 | + | |
| 29941 | + if (statusCode < 200) { | |
| 29942 | + return | |
| 29943 | + } | |
| 29944 | + | |
| 29945 | + /* istanbul ignore next: should be handled by llhttp? */ | |
| 29946 | + if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { | |
| 29947 | + util.destroy(socket, new ResponseContentLengthMismatchError()) | |
| 29948 | + return -1 | |
| 29949 | + } | |
| 29950 | + | |
| 29951 | + request.onComplete(headers) | |
| 29952 | + | |
| 29953 | + client[kQueue][client[kRunningIdx]++] = null | |
| 29954 | + | |
| 29955 | + if (socket[kWriting]) { | |
| 29956 | + assert.strictEqual(client[kRunning], 0) | |
| 29957 | + // Response completed before request. | |
| 29958 | + util.destroy(socket, new InformationalError('reset')) | |
| 29959 | + return constants.ERROR.PAUSED | |
| 29960 | + } else if (!shouldKeepAlive) { | |
| 29961 | + util.destroy(socket, new InformationalError('reset')) | |
| 29962 | + return constants.ERROR.PAUSED | |
| 29963 | + } else if (socket[kReset] && client[kRunning] === 0) { | |
| 29964 | + // Destroy socket once all requests have completed. | |
| 29965 | + // The request at the tail of the pipeline is the one | |
| 29966 | + // that requested reset and no further requests should | |
| 29967 | + // have been queued since then. | |
| 29968 | + util.destroy(socket, new InformationalError('reset')) | |
| 29969 | + return constants.ERROR.PAUSED | |
| 29970 | + } else if (client[kPipelining] === 1) { | |
| 29971 | + // We must wait a full event loop cycle to reuse this socket to make sure | |
| 29972 | + // that non-spec compliant servers are not closing the connection even if they | |
| 29973 | + // said they won't. | |
| 29974 | + setImmediate(resume, client) | |
| 29975 | + } else { | |
| 29976 | + resume(client) | |
| 29977 | + } | |
| 29978 | + } | |
| 29979 | +} | |
| 29980 | + | |
| 29981 | +function onParserTimeout (parser) { | |
| 29982 | + const { socket, timeoutType, client } = parser | |
| 29983 | + | |
| 29984 | + /* istanbul ignore else */ | |
| 29985 | + if (timeoutType === TIMEOUT_HEADERS) { | |
| 29986 | + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { | |
| 29987 | + assert(!parser.paused, 'cannot be paused while waiting for headers') | |
| 29988 | + util.destroy(socket, new HeadersTimeoutError()) | |
| 29989 | + } | |
| 29990 | + } else if (timeoutType === TIMEOUT_BODY) { | |
| 29991 | + if (!parser.paused) { | |
| 29992 | + util.destroy(socket, new BodyTimeoutError()) | |
| 29993 | + } | |
| 29994 | + } else if (timeoutType === TIMEOUT_IDLE) { | |
| 29995 | + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) | |
| 29996 | + util.destroy(socket, new InformationalError('socket idle timeout')) | |
| 29997 | + } | |
| 29998 | +} | |
| 29999 | + | |
| 30000 | +function onSocketReadable () { | |
| 30001 | + const { [kParser]: parser } = this | |
| 30002 | + if (parser) { | |
| 30003 | + parser.readMore() | |
| 30004 | + } | |
| 30005 | +} | |
| 30006 | + | |
| 30007 | +function onSocketError (err) { | |
| 30008 | + const { [kClient]: client, [kParser]: parser } = this | |
| 30009 | + | |
| 30010 | + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') | |
| 30011 | + | |
| 30012 | + if (client[kHTTPConnVersion] !== 'h2') { | |
| 30013 | + // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded | |
| 30014 | + // to the user. | |
| 30015 | + if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { | |
| 30016 | + // We treat all incoming data so for as a valid response. | |
| 30017 | + parser.onMessageComplete() | |
| 30018 | + return | |
| 30019 | + } | |
| 30020 | + } | |
| 30021 | + | |
| 30022 | + this[kError] = err | |
| 30023 | + | |
| 30024 | + onError(this[kClient], err) | |
| 30025 | +} | |
| 30026 | + | |
| 30027 | +function onError (client, err) { | |
| 30028 | + if ( | |
| 30029 | + client[kRunning] === 0 && | |
| 30030 | + err.code !== 'UND_ERR_INFO' && | |
| 30031 | + err.code !== 'UND_ERR_SOCKET' | |
| 30032 | + ) { | |
| 30033 | + // Error is not caused by running request and not a recoverable | |
| 30034 | + // socket error. | |
| 30035 | + | |
| 30036 | + assert(client[kPendingIdx] === client[kRunningIdx]) | |
| 30037 | + | |
| 30038 | + const requests = client[kQueue].splice(client[kRunningIdx]) | |
| 30039 | + for (let i = 0; i < requests.length; i++) { | |
| 30040 | + const request = requests[i] | |
| 30041 | + errorRequest(client, request, err) | |
| 30042 | + } | |
| 30043 | + assert(client[kSize] === 0) | |
| 30044 | + } | |
| 30045 | +} | |
| 30046 | + | |
| 30047 | +function onSocketEnd () { | |
| 30048 | + const { [kParser]: parser, [kClient]: client } = this | |
| 30049 | + | |
| 30050 | + if (client[kHTTPConnVersion] !== 'h2') { | |
| 30051 | + if (parser.statusCode && !parser.shouldKeepAlive) { | |
| 30052 | + // We treat all incoming data so far as a valid response. | |
| 30053 | + parser.onMessageComplete() | |
| 30054 | + return | |
| 30055 | + } | |
| 30056 | + } | |
| 30057 | + | |
| 30058 | + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) | |
| 30059 | +} | |
| 30060 | + | |
| 30061 | +function onSocketClose () { | |
| 30062 | + const { [kClient]: client, [kParser]: parser } = this | |
| 30063 | + | |
| 30064 | + if (client[kHTTPConnVersion] === 'h1' && parser) { | |
| 30065 | + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { | |
| 30066 | + // We treat all incoming data so far as a valid response. | |
| 30067 | + parser.onMessageComplete() | |
| 30068 | + } | |
| 30069 | + | |
| 30070 | + this[kParser].destroy() | |
| 30071 | + this[kParser] = null | |
| 30072 | + } | |
| 30073 | + | |
| 30074 | + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) | |
| 30075 | + | |
| 30076 | + client[kSocket] = null | |
| 30077 | + | |
| 30078 | + if (client.destroyed) { | |
| 30079 | + assert(client[kPending] === 0) | |
| 30080 | + | |
| 30081 | + // Fail entire queue. | |
| 30082 | + const requests = client[kQueue].splice(client[kRunningIdx]) | |
| 30083 | + for (let i = 0; i < requests.length; i++) { | |
| 30084 | + const request = requests[i] | |
| 30085 | + errorRequest(client, request, err) | |
| 30086 | + } | |
| 30087 | + } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { | |
| 30088 | + // Fail head of pipeline. | |
| 30089 | + const request = client[kQueue][client[kRunningIdx]] | |
| 30090 | + client[kQueue][client[kRunningIdx]++] = null | |
| 30091 | + | |
| 30092 | + errorRequest(client, request, err) | |
| 30093 | + } | |
| 30094 | + | |
| 30095 | + client[kPendingIdx] = client[kRunningIdx] | |
| 30096 | + | |
| 30097 | + assert(client[kRunning] === 0) | |
| 30098 | + | |
| 30099 | + client.emit('disconnect', client[kUrl], [client], err) | |
| 30100 | + | |
| 30101 | + resume(client) | |
| 30102 | +} | |
| 30103 | + | |
| 30104 | +async function connect (client) { | |
| 30105 | + assert(!client[kConnecting]) | |
| 30106 | + assert(!client[kSocket]) | |
| 30107 | + | |
| 30108 | + let { host, hostname, protocol, port } = client[kUrl] | |
| 30109 | + | |
| 30110 | + // Resolve ipv6 | |
| 30111 | + if (hostname[0] === '[') { | |
| 30112 | + const idx = hostname.indexOf(']') | |
| 30113 | + | |
| 30114 | + assert(idx !== -1) | |
| 30115 | + const ip = hostname.substring(1, idx) | |
| 30116 | + | |
| 30117 | + assert(net.isIP(ip)) | |
| 30118 | + hostname = ip | |
| 30119 | + } | |
| 30120 | + | |
| 30121 | + client[kConnecting] = true | |
| 30122 | + | |
| 30123 | + if (channels.beforeConnect.hasSubscribers) { | |
| 30124 | + channels.beforeConnect.publish({ | |
| 30125 | + connectParams: { | |
| 30126 | + host, | |
| 30127 | + hostname, | |
| 30128 | + protocol, | |
| 30129 | + port, | |
| 30130 | + servername: client[kServerName], | |
| 30131 | + localAddress: client[kLocalAddress] | |
| 30132 | + }, | |
| 30133 | + connector: client[kConnector] | |
| 30134 | + }) | |
| 30135 | + } | |
| 30136 | + | |
| 30137 | + try { | |
| 30138 | + const socket = await new Promise((resolve, reject) => { | |
| 30139 | + client[kConnector]({ | |
| 30140 | + host, | |
| 30141 | + hostname, | |
| 30142 | + protocol, | |
| 30143 | + port, | |
| 30144 | + servername: client[kServerName], | |
| 30145 | + localAddress: client[kLocalAddress] | |
| 30146 | + }, (err, socket) => { | |
| 30147 | + if (err) { | |
| 30148 | + reject(err) | |
| 30149 | + } else { | |
| 30150 | + resolve(socket) | |
| 30151 | + } | |
| 30152 | + }) | |
| 30153 | + }) | |
| 30154 | + | |
| 30155 | + if (client.destroyed) { | |
| 30156 | + util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) | |
| 30157 | + return | |
| 30158 | + } | |
| 30159 | + | |
| 30160 | + client[kConnecting] = false | |
| 30161 | + | |
| 30162 | + assert(socket) | |
| 30163 | + | |
| 30164 | + const isH2 = socket.alpnProtocol === 'h2' | |
| 30165 | + if (isH2) { | |
| 30166 | + if (!h2ExperimentalWarned) { | |
| 30167 | + h2ExperimentalWarned = true | |
| 30168 | + process.emitWarning('H2 support is experimental, expect them to change at any time.', { | |
| 30169 | + code: 'UNDICI-H2' | |
| 30170 | + }) | |
| 30171 | + } | |
| 30172 | + | |
| 30173 | + const session = http2.connect(client[kUrl], { | |
| 30174 | + createConnection: () => socket, | |
| 30175 | + peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams | |
| 30176 | + }) | |
| 30177 | + | |
| 30178 | + client[kHTTPConnVersion] = 'h2' | |
| 30179 | + session[kClient] = client | |
| 30180 | + session[kSocket] = socket | |
| 30181 | + session.on('error', onHttp2SessionError) | |
| 30182 | + session.on('frameError', onHttp2FrameError) | |
| 30183 | + session.on('end', onHttp2SessionEnd) | |
| 30184 | + session.on('goaway', onHTTP2GoAway) | |
| 30185 | + session.on('close', onSocketClose) | |
| 30186 | + session.unref() | |
| 30187 | + | |
| 30188 | + client[kHTTP2Session] = session | |
| 30189 | + socket[kHTTP2Session] = session | |
| 30190 | + } else { | |
| 30191 | + if (!llhttpInstance) { | |
| 30192 | + llhttpInstance = await llhttpPromise | |
| 30193 | + llhttpPromise = null | |
| 30194 | + } | |
| 30195 | + | |
| 30196 | + socket[kNoRef] = false | |
| 30197 | + socket[kWriting] = false | |
| 30198 | + socket[kReset] = false | |
| 30199 | + socket[kBlocking] = false | |
| 30200 | + socket[kParser] = new Parser(client, socket, llhttpInstance) | |
| 30201 | + } | |
| 30202 | + | |
| 30203 | + socket[kCounter] = 0 | |
| 30204 | + socket[kMaxRequests] = client[kMaxRequests] | |
| 30205 | + socket[kClient] = client | |
| 30206 | + socket[kError] = null | |
| 30207 | + | |
| 30208 | + socket | |
| 30209 | + .on('error', onSocketError) | |
| 30210 | + .on('readable', onSocketReadable) | |
| 30211 | + .on('end', onSocketEnd) | |
| 30212 | + .on('close', onSocketClose) | |
| 30213 | + | |
| 30214 | + client[kSocket] = socket | |
| 30215 | + | |
| 30216 | + if (channels.connected.hasSubscribers) { | |
| 30217 | + channels.connected.publish({ | |
| 30218 | + connectParams: { | |
| 30219 | + host, | |
| 30220 | + hostname, | |
| 30221 | + protocol, | |
| 30222 | + port, | |
| 30223 | + servername: client[kServerName], | |
| 30224 | + localAddress: client[kLocalAddress] | |
| 30225 | + }, | |
| 30226 | + connector: client[kConnector], | |
| 30227 | + socket | |
| 30228 | + }) | |
| 30229 | + } | |
| 30230 | + client.emit('connect', client[kUrl], [client]) | |
| 30231 | + } catch (err) { | |
| 30232 | + if (client.destroyed) { | |
| 30233 | + return | |
| 30234 | + } | |
| 30235 | + | |
| 30236 | + client[kConnecting] = false | |
| 30237 | + | |
| 30238 | + if (channels.connectError.hasSubscribers) { | |
| 30239 | + channels.connectError.publish({ | |
| 30240 | + connectParams: { | |
| 30241 | + host, | |
| 30242 | + hostname, | |
| 30243 | + protocol, | |
| 30244 | + port, | |
| 30245 | + servername: client[kServerName], | |
| 30246 | + localAddress: client[kLocalAddress] | |
| 30247 | + }, | |
| 30248 | + connector: client[kConnector], | |
| 30249 | + error: err | |
| 30250 | + }) | |
| 30251 | + } | |
| 30252 | + | |
| 30253 | + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { | |
| 30254 | + assert(client[kRunning] === 0) | |
| 30255 | + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { | |
| 30256 | + const request = client[kQueue][client[kPendingIdx]++] | |
| 30257 | + errorRequest(client, request, err) | |
| 30258 | + } | |
| 30259 | + } else { | |
| 30260 | + onError(client, err) | |
| 30261 | + } | |
| 30262 | + | |
| 30263 | + client.emit('connectionError', client[kUrl], [client], err) | |
| 30264 | + } | |
| 30265 | + | |
| 30266 | + resume(client) | |
| 30267 | +} | |
| 30268 | + | |
| 30269 | +function emitDrain (client) { | |
| 30270 | + client[kNeedDrain] = 0 | |
| 30271 | + client.emit('drain', client[kUrl], [client]) | |
| 30272 | +} | |
| 30273 | + | |
| 30274 | +function resume (client, sync) { | |
| 30275 | + if (client[kResuming] === 2) { | |
| 30276 | + return | |
| 30277 | + } | |
| 30278 | + | |
| 30279 | + client[kResuming] = 2 | |
| 30280 | + | |
| 30281 | + _resume(client, sync) | |
| 30282 | + client[kResuming] = 0 | |
| 30283 | + | |
| 30284 | + if (client[kRunningIdx] > 256) { | |
| 30285 | + client[kQueue].splice(0, client[kRunningIdx]) | |
| 30286 | + client[kPendingIdx] -= client[kRunningIdx] | |
| 30287 | + client[kRunningIdx] = 0 | |
| 30288 | + } | |
| 30289 | +} | |
| 30290 | + | |
| 30291 | +function _resume (client, sync) { | |
| 30292 | + while (true) { | |
| 30293 | + if (client.destroyed) { | |
| 30294 | + assert(client[kPending] === 0) | |
| 30295 | + return | |
| 30296 | + } | |
| 30297 | + | |
| 30298 | + if (client[kClosedResolve] && !client[kSize]) { | |
| 30299 | + client[kClosedResolve]() | |
| 30300 | + client[kClosedResolve] = null | |
| 30301 | + return | |
| 30302 | + } | |
| 30303 | + | |
| 30304 | + const socket = client[kSocket] | |
| 30305 | + | |
| 30306 | + if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { | |
| 30307 | + if (client[kSize] === 0) { | |
| 30308 | + if (!socket[kNoRef] && socket.unref) { | |
| 30309 | + socket.unref() | |
| 30310 | + socket[kNoRef] = true | |
| 30311 | + } | |
| 30312 | + } else if (socket[kNoRef] && socket.ref) { | |
| 30313 | + socket.ref() | |
| 30314 | + socket[kNoRef] = false | |
| 30315 | + } | |
| 30316 | + | |
| 30317 | + if (client[kSize] === 0) { | |
| 30318 | + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { | |
| 30319 | + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) | |
| 30320 | + } | |
| 30321 | + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { | |
| 30322 | + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { | |
| 30323 | + const request = client[kQueue][client[kRunningIdx]] | |
| 30324 | + const headersTimeout = request.headersTimeout != null | |
| 30325 | + ? request.headersTimeout | |
| 30326 | + : client[kHeadersTimeout] | |
| 30327 | + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) | |
| 30328 | + } | |
| 30329 | + } | |
| 30330 | + } | |
| 30331 | + | |
| 30332 | + if (client[kBusy]) { | |
| 30333 | + client[kNeedDrain] = 2 | |
| 30334 | + } else if (client[kNeedDrain] === 2) { | |
| 30335 | + if (sync) { | |
| 30336 | + client[kNeedDrain] = 1 | |
| 30337 | + process.nextTick(emitDrain, client) | |
| 30338 | + } else { | |
| 30339 | + emitDrain(client) | |
| 30340 | + } | |
| 30341 | + continue | |
| 30342 | + } | |
| 30343 | + | |
| 30344 | + if (client[kPending] === 0) { | |
| 30345 | + return | |
| 30346 | + } | |
| 30347 | + | |
| 30348 | + if (client[kRunning] >= (client[kPipelining] || 1)) { | |
| 30349 | + return | |
| 30350 | + } | |
| 30351 | + | |
| 30352 | + const request = client[kQueue][client[kPendingIdx]] | |
| 30353 | + | |
| 30354 | + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { | |
| 30355 | + if (client[kRunning] > 0) { | |
| 30356 | + return | |
| 30357 | + } | |
| 30358 | + | |
| 30359 | + client[kServerName] = request.servername | |
| 30360 | + | |
| 30361 | + if (socket && socket.servername !== request.servername) { | |
| 30362 | + util.destroy(socket, new InformationalError('servername changed')) | |
| 30363 | + return | |
| 30364 | + } | |
| 30365 | + } | |
| 30366 | + | |
| 30367 | + if (client[kConnecting]) { | |
| 30368 | + return | |
| 30369 | + } | |
| 30370 | + | |
| 30371 | + if (!socket && !client[kHTTP2Session]) { | |
| 30372 | + connect(client) | |
| 30373 | + return | |
| 30374 | + } | |
| 30375 | + | |
| 30376 | + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { | |
| 30377 | + return | |
| 30378 | + } | |
| 30379 | + | |
| 30380 | + if (client[kRunning] > 0 && !request.idempotent) { | |
| 30381 | + // Non-idempotent request cannot be retried. | |
| 30382 | + // Ensure that no other requests are inflight and | |
| 30383 | + // could cause failure. | |
| 30384 | + return | |
| 30385 | + } | |
| 30386 | + | |
| 30387 | + if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { | |
| 30388 | + // Don't dispatch an upgrade until all preceding requests have completed. | |
| 30389 | + // A misbehaving server might upgrade the connection before all pipelined | |
| 30390 | + // request has completed. | |
| 30391 | + return | |
| 30392 | + } | |
| 30393 | + | |
| 30394 | + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && | |
| 30395 | + (util.isStream(request.body) || util.isAsyncIterable(request.body))) { | |
| 30396 | + // Request with stream or iterator body can error while other requests | |
| 30397 | + // are inflight and indirectly error those as well. | |
| 30398 | + // Ensure this doesn't happen by waiting for inflight | |
| 30399 | + // to complete before dispatching. | |
| 30400 | + | |
| 30401 | + // Request with stream or iterator body cannot be retried. | |
| 30402 | + // Ensure that no other requests are inflight and | |
| 30403 | + // could cause failure. | |
| 30404 | + return | |
| 30405 | + } | |
| 30406 | + | |
| 30407 | + if (!request.aborted && write(client, request)) { | |
| 30408 | + client[kPendingIdx]++ | |
| 30409 | + } else { | |
| 30410 | + client[kQueue].splice(client[kPendingIdx], 1) | |
| 30411 | + } | |
| 30412 | + } | |
| 30413 | +} | |
| 30414 | + | |
| 30415 | +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 | |
| 30416 | +function shouldSendContentLength (method) { | |
| 30417 | + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' | |
| 30418 | +} | |
| 30419 | + | |
| 30420 | +function write (client, request) { | |
| 30421 | + if (client[kHTTPConnVersion] === 'h2') { | |
| 30422 | + writeH2(client, client[kHTTP2Session], request) | |
| 30423 | + return | |
| 30424 | + } | |
| 30425 | + | |
| 30426 | + const { body, method, path, host, upgrade, headers, blocking, reset } = request | |
| 30427 | + | |
| 30428 | + // https://tools.ietf.org/html/rfc7231#section-4.3.1 | |
| 30429 | + // https://tools.ietf.org/html/rfc7231#section-4.3.2 | |
| 30430 | + // https://tools.ietf.org/html/rfc7231#section-4.3.5 | |
| 30431 | + | |
| 30432 | + // Sending a payload body on a request that does not | |
| 30433 | + // expect it can cause undefined behavior on some | |
| 30434 | + // servers and corrupt connection state. Do not | |
| 30435 | + // re-use the connection for further requests. | |
| 30436 | + | |
| 30437 | + const expectsPayload = ( | |
| 30438 | + method === 'PUT' || | |
| 30439 | + method === 'POST' || | |
| 30440 | + method === 'PATCH' | |
| 30441 | + ) | |
| 30442 | + | |
| 30443 | + if (body && typeof body.read === 'function') { | |
| 30444 | + // Try to read EOF in order to get length. | |
| 30445 | + body.read(0) | |
| 30446 | + } | |
| 30447 | + | |
| 30448 | + const bodyLength = util.bodyLength(body) | |
| 30449 | + | |
| 30450 | + let contentLength = bodyLength | |
| 30451 | + | |
| 30452 | + if (contentLength === null) { | |
| 30453 | + contentLength = request.contentLength | |
| 30454 | + } | |
| 30455 | + | |
| 30456 | + if (contentLength === 0 && !expectsPayload) { | |
| 30457 | + // https://tools.ietf.org/html/rfc7230#section-3.3.2 | |
| 30458 | + // A user agent SHOULD NOT send a Content-Length header field when | |
| 30459 | + // the request message does not contain a payload body and the method | |
| 30460 | + // semantics do not anticipate such a body. | |
| 30461 | + | |
| 30462 | + contentLength = null | |
| 30463 | + } | |
| 30464 | + | |
| 30465 | + // https://github.com/nodejs/undici/issues/2046 | |
| 30466 | + // A user agent may send a Content-Length header with 0 value, this should be allowed. | |
| 30467 | + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { | |
| 30468 | + if (client[kStrictContentLength]) { | |
| 30469 | + errorRequest(client, request, new RequestContentLengthMismatchError()) | |
| 30470 | + return false | |
| 30471 | + } | |
| 30472 | + | |
| 30473 | + process.emitWarning(new RequestContentLengthMismatchError()) | |
| 30474 | + } | |
| 30475 | + | |
| 30476 | + const socket = client[kSocket] | |
| 30477 | + | |
| 30478 | + try { | |
| 30479 | + request.onConnect((err) => { | |
| 30480 | + if (request.aborted || request.completed) { | |
| 30481 | + return | |
| 30482 | + } | |
| 30483 | + | |
| 30484 | + errorRequest(client, request, err || new RequestAbortedError()) | |
| 30485 | + | |
| 30486 | + util.destroy(socket, new InformationalError('aborted')) | |
| 30487 | + }) | |
| 30488 | + } catch (err) { | |
| 30489 | + errorRequest(client, request, err) | |
| 30490 | + } | |
| 30491 | + | |
| 30492 | + if (request.aborted) { | |
| 30493 | + return false | |
| 30494 | + } | |
| 30495 | + | |
| 30496 | + if (method === 'HEAD') { | |
| 30497 | + // https://github.com/mcollina/undici/issues/258 | |
| 30498 | + // Close after a HEAD request to interop with misbehaving servers | |
| 30499 | + // that may send a body in the response. | |
| 30500 | + | |
| 30501 | + socket[kReset] = true | |
| 30502 | + } | |
| 30503 | + | |
| 30504 | + if (upgrade || method === 'CONNECT') { | |
| 30505 | + // On CONNECT or upgrade, block pipeline from dispatching further | |
| 30506 | + // requests on this connection. | |
| 30507 | + | |
| 30508 | + socket[kReset] = true | |
| 30509 | + } | |
| 30510 | + | |
| 30511 | + if (reset != null) { | |
| 30512 | + socket[kReset] = reset | |
| 30513 | + } | |
| 30514 | + | |
| 30515 | + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { | |
| 30516 | + socket[kReset] = true | |
| 30517 | + } | |
| 30518 | + | |
| 30519 | + if (blocking) { | |
| 30520 | + socket[kBlocking] = true | |
| 30521 | + } | |
| 30522 | + | |
| 30523 | + let header = `${method} ${path} HTTP/1.1\r\n` | |
| 30524 | + | |
| 30525 | + if (typeof host === 'string') { | |
| 30526 | + header += `host: ${host}\r\n` | |
| 30527 | + } else { | |
| 30528 | + header += client[kHostHeader] | |
| 30529 | + } | |
| 30530 | + | |
| 30531 | + if (upgrade) { | |
| 30532 | + header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` | |
| 30533 | + } else if (client[kPipelining] && !socket[kReset]) { | |
| 30534 | + header += 'connection: keep-alive\r\n' | |
| 30535 | + } else { | |
| 30536 | + header += 'connection: close\r\n' | |
| 30537 | + } | |
| 30538 | + | |
| 30539 | + if (headers) { | |
| 30540 | + header += headers | |
| 30541 | + } | |
| 30542 | + | |
| 30543 | + if (channels.sendHeaders.hasSubscribers) { | |
| 30544 | + channels.sendHeaders.publish({ request, headers: header, socket }) | |
| 30545 | + } | |
| 30546 | + | |
| 30547 | + /* istanbul ignore else: assertion */ | |
| 30548 | + if (!body || bodyLength === 0) { | |
| 30549 | + if (contentLength === 0) { | |
| 30550 | + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') | |
| 30551 | + } else { | |
| 30552 | + assert(contentLength === null, 'no body must not have content length') | |
| 30553 | + socket.write(`${header}\r\n`, 'latin1') | |
| 30554 | + } | |
| 30555 | + request.onRequestSent() | |
| 30556 | + } else if (util.isBuffer(body)) { | |
| 30557 | + assert(contentLength === body.byteLength, 'buffer body must have content length') | |
| 30558 | + | |
| 30559 | + socket.cork() | |
| 30560 | + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') | |
| 30561 | + socket.write(body) | |
| 30562 | + socket.uncork() | |
| 30563 | + request.onBodySent(body) | |
| 30564 | + request.onRequestSent() | |
| 30565 | + if (!expectsPayload) { | |
| 30566 | + socket[kReset] = true | |
| 30567 | + } | |
| 30568 | + } else if (util.isBlobLike(body)) { | |
| 30569 | + if (typeof body.stream === 'function') { | |
| 30570 | + writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) | |
| 30571 | + } else { | |
| 30572 | + writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) | |
| 30573 | + } | |
| 30574 | + } else if (util.isStream(body)) { | |
| 30575 | + writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) | |
| 30576 | + } else if (util.isIterable(body)) { | |
| 30577 | + writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) | |
| 30578 | + } else { | |
| 30579 | + assert(false) | |
| 30580 | + } | |
| 30581 | + | |
| 30582 | + return true | |
| 30583 | +} | |
| 30584 | + | |
| 30585 | +function writeH2 (client, session, request) { | |
| 30586 | + const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request | |
| 30587 | + | |
| 30588 | + let headers | |
| 30589 | + if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) | |
| 30590 | + else headers = reqHeaders | |
| 30591 | + | |
| 30592 | + if (upgrade) { | |
| 30593 | + errorRequest(client, request, new Error('Upgrade not supported for H2')) | |
| 30594 | + return false | |
| 30595 | + } | |
| 30596 | + | |
| 30597 | + try { | |
| 30598 | + // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? | |
| 30599 | + request.onConnect((err) => { | |
| 30600 | + if (request.aborted || request.completed) { | |
| 30601 | + return | |
| 30602 | + } | |
| 30603 | + | |
| 30604 | + errorRequest(client, request, err || new RequestAbortedError()) | |
| 30605 | + }) | |
| 30606 | + } catch (err) { | |
| 30607 | + errorRequest(client, request, err) | |
| 30608 | + } | |
| 30609 | + | |
| 30610 | + if (request.aborted) { | |
| 30611 | + return false | |
| 30612 | + } | |
| 30613 | + | |
| 30614 | + /** @type {import('node:http2').ClientHttp2Stream} */ | |
| 30615 | + let stream | |
| 30616 | + const h2State = client[kHTTP2SessionState] | |
| 30617 | + | |
| 30618 | + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] | |
| 30619 | + headers[HTTP2_HEADER_METHOD] = method | |
| 30620 | + | |
| 30621 | + if (method === 'CONNECT') { | |
| 30622 | + session.ref() | |
| 30623 | + // we are already connected, streams are pending, first request | |
| 30624 | + // will create a new stream. We trigger a request to create the stream and wait until | |
| 30625 | + // `ready` event is triggered | |
| 30626 | + // We disabled endStream to allow the user to write to the stream | |
| 30627 | + stream = session.request(headers, { endStream: false, signal }) | |
| 30628 | + | |
| 30629 | + if (stream.id && !stream.pending) { | |
| 30630 | + request.onUpgrade(null, null, stream) | |
| 30631 | + ++h2State.openStreams | |
| 30632 | + } else { | |
| 30633 | + stream.once('ready', () => { | |
| 30634 | + request.onUpgrade(null, null, stream) | |
| 30635 | + ++h2State.openStreams | |
| 30636 | + }) | |
| 30637 | + } | |
| 30638 | + | |
| 30639 | + stream.once('close', () => { | |
| 30640 | + h2State.openStreams -= 1 | |
| 30641 | + // TODO(HTTP/2): unref only if current streams count is 0 | |
| 30642 | + if (h2State.openStreams === 0) session.unref() | |
| 30643 | + }) | |
| 30644 | + | |
| 30645 | + return true | |
| 30646 | + } | |
| 30647 | + | |
| 30648 | + // https://tools.ietf.org/html/rfc7540#section-8.3 | |
| 30649 | + // :path and :scheme headers must be omited when sending CONNECT | |
| 30650 | + | |
| 30651 | + headers[HTTP2_HEADER_PATH] = path | |
| 30652 | + headers[HTTP2_HEADER_SCHEME] = 'https' | |
| 30653 | + | |
| 30654 | + // https://tools.ietf.org/html/rfc7231#section-4.3.1 | |
| 30655 | + // https://tools.ietf.org/html/rfc7231#section-4.3.2 | |
| 30656 | + // https://tools.ietf.org/html/rfc7231#section-4.3.5 | |
| 30657 | + | |
| 30658 | + // Sending a payload body on a request that does not | |
| 30659 | + // expect it can cause undefined behavior on some | |
| 30660 | + // servers and corrupt connection state. Do not | |
| 30661 | + // re-use the connection for further requests. | |
| 30662 | + | |
| 30663 | + const expectsPayload = ( | |
| 30664 | + method === 'PUT' || | |
| 30665 | + method === 'POST' || | |
| 30666 | + method === 'PATCH' | |
| 30667 | + ) | |
| 30668 | + | |
| 30669 | + if (body && typeof body.read === 'function') { | |
| 30670 | + // Try to read EOF in order to get length. | |
| 30671 | + body.read(0) | |
| 30672 | + } | |
| 30673 | + | |
| 30674 | + let contentLength = util.bodyLength(body) | |
| 30675 | + | |
| 30676 | + if (contentLength == null) { | |
| 30677 | + contentLength = request.contentLength | |
| 30678 | + } | |
| 30679 | + | |
| 30680 | + if (contentLength === 0 || !expectsPayload) { | |
| 30681 | + // https://tools.ietf.org/html/rfc7230#section-3.3.2 | |
| 30682 | + // A user agent SHOULD NOT send a Content-Length header field when | |
| 30683 | + // the request message does not contain a payload body and the method | |
| 30684 | + // semantics do not anticipate such a body. | |
| 30685 | + | |
| 30686 | + contentLength = null | |
| 30687 | + } | |
| 30688 | + | |
| 30689 | + // https://github.com/nodejs/undici/issues/2046 | |
| 30690 | + // A user agent may send a Content-Length header with 0 value, this should be allowed. | |
| 30691 | + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { | |
| 30692 | + if (client[kStrictContentLength]) { | |
| 30693 | + errorRequest(client, request, new RequestContentLengthMismatchError()) | |
| 30694 | + return false | |
| 30695 | + } | |
| 30696 | + | |
| 30697 | + process.emitWarning(new RequestContentLengthMismatchError()) | |
| 30698 | + } | |
| 30699 | + | |
| 30700 | + if (contentLength != null) { | |
| 30701 | + assert(body, 'no body must not have content length') | |
| 30702 | + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` | |
| 30703 | + } | |
| 30704 | + | |
| 30705 | + session.ref() | |
| 30706 | + | |
| 30707 | + const shouldEndStream = method === 'GET' || method === 'HEAD' | |
| 30708 | + if (expectContinue) { | |
| 30709 | + headers[HTTP2_HEADER_EXPECT] = '100-continue' | |
| 30710 | + stream = session.request(headers, { endStream: shouldEndStream, signal }) | |
| 30711 | + | |
| 30712 | + stream.once('continue', writeBodyH2) | |
| 30713 | + } else { | |
| 30714 | + stream = session.request(headers, { | |
| 30715 | + endStream: shouldEndStream, | |
| 30716 | + signal | |
| 30717 | + }) | |
| 30718 | + writeBodyH2() | |
| 30719 | + } | |
| 30720 | + | |
| 30721 | + // Increment counter as we have new several streams open | |
| 30722 | + ++h2State.openStreams | |
| 30723 | + | |
| 30724 | + stream.once('response', headers => { | |
| 30725 | + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers | |
| 30726 | + | |
| 30727 | + if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { | |
| 30728 | + stream.pause() | |
| 30729 | + } | |
| 30730 | + }) | |
| 30731 | + | |
| 30732 | + stream.once('end', () => { | |
| 30733 | + request.onComplete([]) | |
| 30734 | + }) | |
| 30735 | + | |
| 30736 | + stream.on('data', (chunk) => { | |
| 30737 | + if (request.onData(chunk) === false) { | |
| 30738 | + stream.pause() | |
| 30739 | + } | |
| 30740 | + }) | |
| 30741 | + | |
| 30742 | + stream.once('close', () => { | |
| 30743 | + h2State.openStreams -= 1 | |
| 30744 | + // TODO(HTTP/2): unref only if current streams count is 0 | |
| 30745 | + if (h2State.openStreams === 0) { | |
| 30746 | + session.unref() | |
| 30747 | + } | |
| 30748 | + }) | |
| 30749 | + | |
| 30750 | + stream.once('error', function (err) { | |
| 30751 | + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { | |
| 30752 | + h2State.streams -= 1 | |
| 30753 | + util.destroy(stream, err) | |
| 30754 | + } | |
| 30755 | + }) | |
| 30756 | + | |
| 30757 | + stream.once('frameError', (type, code) => { | |
| 30758 | + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) | |
| 30759 | + errorRequest(client, request, err) | |
| 30760 | + | |
| 30761 | + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { | |
| 30762 | + h2State.streams -= 1 | |
| 30763 | + util.destroy(stream, err) | |
| 30764 | + } | |
| 30765 | + }) | |
| 30766 | + | |
| 30767 | + // stream.on('aborted', () => { | |
| 30768 | + // // TODO(HTTP/2): Support aborted | |
| 30769 | + // }) | |
| 30770 | + | |
| 30771 | + // stream.on('timeout', () => { | |
| 30772 | + // // TODO(HTTP/2): Support timeout | |
| 30773 | + // }) | |
| 30774 | + | |
| 30775 | + // stream.on('push', headers => { | |
| 30776 | + // // TODO(HTTP/2): Suppor push | |
| 30777 | + // }) | |
| 30778 | + | |
| 30779 | + // stream.on('trailers', headers => { | |
| 30780 | + // // TODO(HTTP/2): Support trailers | |
| 30781 | + // }) | |
| 30782 | + | |
| 30783 | + return true | |
| 30784 | + | |
| 30785 | + function writeBodyH2 () { | |
| 30786 | + /* istanbul ignore else: assertion */ | |
| 30787 | + if (!body) { | |
| 30788 | + request.onRequestSent() | |
| 30789 | + } else if (util.isBuffer(body)) { | |
| 30790 | + assert(contentLength === body.byteLength, 'buffer body must have content length') | |
| 30791 | + stream.cork() | |
| 30792 | + stream.write(body) | |
| 30793 | + stream.uncork() | |
| 30794 | + stream.end() | |
| 30795 | + request.onBodySent(body) | |
| 30796 | + request.onRequestSent() | |
| 30797 | + } else if (util.isBlobLike(body)) { | |
| 30798 | + if (typeof body.stream === 'function') { | |
| 30799 | + writeIterable({ | |
| 30800 | + client, | |
| 30801 | + request, | |
| 30802 | + contentLength, | |
| 30803 | + h2stream: stream, | |
| 30804 | + expectsPayload, | |
| 30805 | + body: body.stream(), | |
| 30806 | + socket: client[kSocket], | |
| 30807 | + header: '' | |
| 30808 | + }) | |
| 30809 | + } else { | |
| 30810 | + writeBlob({ | |
| 30811 | + body, | |
| 30812 | + client, | |
| 30813 | + request, | |
| 30814 | + contentLength, | |
| 30815 | + expectsPayload, | |
| 30816 | + h2stream: stream, | |
| 30817 | + header: '', | |
| 30818 | + socket: client[kSocket] | |
| 30819 | + }) | |
| 30820 | + } | |
| 30821 | + } else if (util.isStream(body)) { | |
| 30822 | + writeStream({ | |
| 30823 | + body, | |
| 30824 | + client, | |
| 30825 | + request, | |
| 30826 | + contentLength, | |
| 30827 | + expectsPayload, | |
| 30828 | + socket: client[kSocket], | |
| 30829 | + h2stream: stream, | |
| 30830 | + header: '' | |
| 30831 | + }) | |
| 30832 | + } else if (util.isIterable(body)) { | |
| 30833 | + writeIterable({ | |
| 30834 | + body, | |
| 30835 | + client, | |
| 30836 | + request, | |
| 30837 | + contentLength, | |
| 30838 | + expectsPayload, | |
| 30839 | + header: '', | |
| 30840 | + h2stream: stream, | |
| 30841 | + socket: client[kSocket] | |
| 30842 | + }) | |
| 30843 | + } else { | |
| 30844 | + assert(false) | |
| 30845 | + } | |
| 30846 | + } | |
| 30847 | +} | |
| 30848 | + | |
| 30849 | +function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { | |
| 30850 | + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') | |
| 30851 | + | |
| 30852 | + if (client[kHTTPConnVersion] === 'h2') { | |
| 30853 | + // For HTTP/2, is enough to pipe the stream | |
| 30854 | + const pipe = pipeline( | |
| 30855 | + body, | |
| 30856 | + h2stream, | |
| 30857 | + (err) => { | |
| 30858 | + if (err) { | |
| 30859 | + util.destroy(body, err) | |
| 30860 | + util.destroy(h2stream, err) | |
| 30861 | + } else { | |
| 30862 | + request.onRequestSent() | |
| 30863 | + } | |
| 30864 | + } | |
| 30865 | + ) | |
| 30866 | + | |
| 30867 | + pipe.on('data', onPipeData) | |
| 30868 | + pipe.once('end', () => { | |
| 30869 | + pipe.removeListener('data', onPipeData) | |
| 30870 | + util.destroy(pipe) | |
| 30871 | + }) | |
| 30872 | + | |
| 30873 | + function onPipeData (chunk) { | |
| 30874 | + request.onBodySent(chunk) | |
| 30875 | + } | |
| 30876 | + | |
| 30877 | + return | |
| 30878 | + } | |
| 30879 | + | |
| 30880 | + let finished = false | |
| 30881 | + | |
| 30882 | + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) | |
| 30883 | + | |
| 30884 | + const onData = function (chunk) { | |
| 30885 | + if (finished) { | |
| 30886 | + return | |
| 30887 | + } | |
| 30888 | + | |
| 30889 | + try { | |
| 30890 | + if (!writer.write(chunk) && this.pause) { | |
| 30891 | + this.pause() | |
| 30892 | + } | |
| 30893 | + } catch (err) { | |
| 30894 | + util.destroy(this, err) | |
| 30895 | + } | |
| 30896 | + } | |
| 30897 | + const onDrain = function () { | |
| 30898 | + if (finished) { | |
| 30899 | + return | |
| 30900 | + } | |
| 30901 | + | |
| 30902 | + if (body.resume) { | |
| 30903 | + body.resume() | |
| 30904 | + } | |
| 30905 | + } | |
| 30906 | + const onAbort = function () { | |
| 30907 | + if (finished) { | |
| 30908 | + return | |
| 30909 | + } | |
| 30910 | + const err = new RequestAbortedError() | |
| 30911 | + queueMicrotask(() => onFinished(err)) | |
| 30912 | + } | |
| 30913 | + const onFinished = function (err) { | |
| 30914 | + if (finished) { | |
| 30915 | + return | |
| 30916 | + } | |
| 30917 | + | |
| 30918 | + finished = true | |
| 30919 | + | |
| 30920 | + assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) | |
| 30921 | + | |
| 30922 | + socket | |
| 30923 | + .off('drain', onDrain) | |
| 30924 | + .off('error', onFinished) | |
| 30925 | + | |
| 30926 | + body | |
| 30927 | + .removeListener('data', onData) | |
| 30928 | + .removeListener('end', onFinished) | |
| 30929 | + .removeListener('error', onFinished) | |
| 30930 | + .removeListener('close', onAbort) | |
| 30931 | + | |
| 30932 | + if (!err) { | |
| 30933 | + try { | |
| 30934 | + writer.end() | |
| 30935 | + } catch (er) { | |
| 30936 | + err = er | |
| 30937 | + } | |
| 30938 | + } | |
| 30939 | + | |
| 30940 | + writer.destroy(err) | |
| 30941 | + | |
| 30942 | + if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { | |
| 30943 | + util.destroy(body, err) | |
| 30944 | + } else { | |
| 30945 | + util.destroy(body) | |
| 30946 | + } | |
| 30947 | + } | |
| 30948 | + | |
| 30949 | + body | |
| 30950 | + .on('data', onData) | |
| 30951 | + .on('end', onFinished) | |
| 30952 | + .on('error', onFinished) | |
| 30953 | + .on('close', onAbort) | |
| 30954 | + | |
| 30955 | + if (body.resume) { | |
| 30956 | + body.resume() | |
| 30957 | + } | |
| 30958 | + | |
| 30959 | + socket | |
| 30960 | + .on('drain', onDrain) | |
| 30961 | + .on('error', onFinished) | |
| 30962 | +} | |
| 30963 | + | |
| 30964 | +async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { | |
| 30965 | + assert(contentLength === body.size, 'blob body must have content length') | |
| 30966 | + | |
| 30967 | + const isH2 = client[kHTTPConnVersion] === 'h2' | |
| 30968 | + try { | |
| 30969 | + if (contentLength != null && contentLength !== body.size) { | |
| 30970 | + throw new RequestContentLengthMismatchError() | |
| 30971 | + } | |
| 30972 | + | |
| 30973 | + const buffer = Buffer.from(await body.arrayBuffer()) | |
| 30974 | + | |
| 30975 | + if (isH2) { | |
| 30976 | + h2stream.cork() | |
| 30977 | + h2stream.write(buffer) | |
| 30978 | + h2stream.uncork() | |
| 30979 | + } else { | |
| 30980 | + socket.cork() | |
| 30981 | + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') | |
| 30982 | + socket.write(buffer) | |
| 30983 | + socket.uncork() | |
| 30984 | + } | |
| 30985 | + | |
| 30986 | + request.onBodySent(buffer) | |
| 30987 | + request.onRequestSent() | |
| 30988 | + | |
| 30989 | + if (!expectsPayload) { | |
| 30990 | + socket[kReset] = true | |
| 30991 | + } | |
| 30992 | + | |
| 30993 | + resume(client) | |
| 30994 | + } catch (err) { | |
| 30995 | + util.destroy(isH2 ? h2stream : socket, err) | |
| 30996 | + } | |
| 30997 | +} | |
| 30998 | + | |
| 30999 | +async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { | |
| 31000 | + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') | |
| 31001 | + | |
| 31002 | + let callback = null | |
| 31003 | + function onDrain () { | |
| 31004 | + if (callback) { | |
| 31005 | + const cb = callback | |
| 31006 | + callback = null | |
| 31007 | + cb() | |
| 31008 | + } | |
| 31009 | + } | |
| 31010 | + | |
| 31011 | + const waitForDrain = () => new Promise((resolve, reject) => { | |
| 31012 | + assert(callback === null) | |
| 31013 | + | |
| 31014 | + if (socket[kError]) { | |
| 31015 | + reject(socket[kError]) | |
| 31016 | + } else { | |
| 31017 | + callback = resolve | |
| 31018 | + } | |
| 31019 | + }) | |
| 31020 | + | |
| 31021 | + if (client[kHTTPConnVersion] === 'h2') { | |
| 31022 | + h2stream | |
| 31023 | + .on('close', onDrain) | |
| 31024 | + .on('drain', onDrain) | |
| 31025 | + | |
| 31026 | + try { | |
| 31027 | + // It's up to the user to somehow abort the async iterable. | |
| 31028 | + for await (const chunk of body) { | |
| 31029 | + if (socket[kError]) { | |
| 31030 | + throw socket[kError] | |
| 31031 | + } | |
| 31032 | + | |
| 31033 | + const res = h2stream.write(chunk) | |
| 31034 | + request.onBodySent(chunk) | |
| 31035 | + if (!res) { | |
| 31036 | + await waitForDrain() | |
| 31037 | + } | |
| 31038 | + } | |
| 31039 | + } catch (err) { | |
| 31040 | + h2stream.destroy(err) | |
| 31041 | + } finally { | |
| 31042 | + request.onRequestSent() | |
| 31043 | + h2stream.end() | |
| 31044 | + h2stream | |
| 31045 | + .off('close', onDrain) | |
| 31046 | + .off('drain', onDrain) | |
| 31047 | + } | |
| 31048 | + | |
| 31049 | + return | |
| 31050 | + } | |
| 31051 | + | |
| 31052 | + socket | |
| 31053 | + .on('close', onDrain) | |
| 31054 | + .on('drain', onDrain) | |
| 31055 | + | |
| 31056 | + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) | |
| 31057 | + try { | |
| 31058 | + // It's up to the user to somehow abort the async iterable. | |
| 31059 | + for await (const chunk of body) { | |
| 31060 | + if (socket[kError]) { | |
| 31061 | + throw socket[kError] | |
| 31062 | + } | |
| 31063 | + | |
| 31064 | + if (!writer.write(chunk)) { | |
| 31065 | + await waitForDrain() | |
| 31066 | + } | |
| 31067 | + } | |
| 31068 | + | |
| 31069 | + writer.end() | |
| 31070 | + } catch (err) { | |
| 31071 | + writer.destroy(err) | |
| 31072 | + } finally { | |
| 31073 | + socket | |
| 31074 | + .off('close', onDrain) | |
| 31075 | + .off('drain', onDrain) | |
| 31076 | + } | |
| 31077 | +} | |
| 31078 | + | |
| 31079 | +class AsyncWriter { | |
| 31080 | + constructor ({ socket, request, contentLength, client, expectsPayload, header }) { | |
| 31081 | + this.socket = socket | |
| 31082 | + this.request = request | |
| 31083 | + this.contentLength = contentLength | |
| 31084 | + this.client = client | |
| 31085 | + this.bytesWritten = 0 | |
| 31086 | + this.expectsPayload = expectsPayload | |
| 31087 | + this.header = header | |
| 31088 | + | |
| 31089 | + socket[kWriting] = true | |
| 31090 | + } | |
| 31091 | + | |
| 31092 | + write (chunk) { | |
| 31093 | + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this | |
| 31094 | + | |
| 31095 | + if (socket[kError]) { | |
| 31096 | + throw socket[kError] | |
| 31097 | + } | |
| 31098 | + | |
| 31099 | + if (socket.destroyed) { | |
| 31100 | + return false | |
| 31101 | + } | |
| 31102 | + | |
| 31103 | + const len = Buffer.byteLength(chunk) | |
| 31104 | + if (!len) { | |
| 31105 | + return true | |
| 31106 | + } | |
| 31107 | + | |
| 31108 | + // We should defer writing chunks. | |
| 31109 | + if (contentLength !== null && bytesWritten + len > contentLength) { | |
| 31110 | + if (client[kStrictContentLength]) { | |
| 31111 | + throw new RequestContentLengthMismatchError() | |
| 31112 | + } | |
| 31113 | + | |
| 31114 | + process.emitWarning(new RequestContentLengthMismatchError()) | |
| 31115 | + } | |
| 31116 | + | |
| 31117 | + socket.cork() | |
| 31118 | + | |
| 31119 | + if (bytesWritten === 0) { | |
| 31120 | + if (!expectsPayload) { | |
| 31121 | + socket[kReset] = true | |
| 31122 | + } | |
| 31123 | + | |
| 31124 | + if (contentLength === null) { | |
| 31125 | + socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') | |
| 31126 | + } else { | |
| 31127 | + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') | |
| 31128 | + } | |
| 31129 | + } | |
| 31130 | + | |
| 31131 | + if (contentLength === null) { | |
| 31132 | + socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') | |
| 31133 | + } | |
| 31134 | + | |
| 31135 | + this.bytesWritten += len | |
| 31136 | + | |
| 31137 | + const ret = socket.write(chunk) | |
| 31138 | + | |
| 31139 | + socket.uncork() | |
| 31140 | + | |
| 31141 | + request.onBodySent(chunk) | |
| 31142 | + | |
| 31143 | + if (!ret) { | |
| 31144 | + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { | |
| 31145 | + // istanbul ignore else: only for jest | |
| 31146 | + if (socket[kParser].timeout.refresh) { | |
| 31147 | + socket[kParser].timeout.refresh() | |
| 31148 | + } | |
| 31149 | + } | |
| 31150 | + } | |
| 31151 | + | |
| 31152 | + return ret | |
| 31153 | + } | |
| 31154 | + | |
| 31155 | + end () { | |
| 31156 | + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this | |
| 31157 | + request.onRequestSent() | |
| 31158 | + | |
| 31159 | + socket[kWriting] = false | |
| 31160 | + | |
| 31161 | + if (socket[kError]) { | |
| 31162 | + throw socket[kError] | |
| 31163 | + } | |
| 31164 | + | |
| 31165 | + if (socket.destroyed) { | |
| 31166 | + return | |
| 31167 | + } | |
| 31168 | + | |
| 31169 | + if (bytesWritten === 0) { | |
| 31170 | + if (expectsPayload) { | |
| 31171 | + // https://tools.ietf.org/html/rfc7230#section-3.3.2 | |
| 31172 | + // A user agent SHOULD send a Content-Length in a request message when | |
| 31173 | + // no Transfer-Encoding is sent and the request method defines a meaning | |
| 31174 | + // for an enclosed payload body. | |
| 31175 | + | |
| 31176 | + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') | |
| 31177 | + } else { | |
| 31178 | + socket.write(`${header}\r\n`, 'latin1') | |
| 31179 | + } | |
| 31180 | + } else if (contentLength === null) { | |
| 31181 | + socket.write('\r\n0\r\n\r\n', 'latin1') | |
| 31182 | + } | |
| 31183 | + | |
| 31184 | + if (contentLength !== null && bytesWritten !== contentLength) { | |
| 31185 | + if (client[kStrictContentLength]) { | |
| 31186 | + throw new RequestContentLengthMismatchError() | |
| 31187 | + } else { | |
| 31188 | + process.emitWarning(new RequestContentLengthMismatchError()) | |
| 31189 | + } | |
| 31190 | + } | |
| 31191 | + | |
| 31192 | + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { | |
| 31193 | + // istanbul ignore else: only for jest | |
| 31194 | + if (socket[kParser].timeout.refresh) { | |
| 31195 | + socket[kParser].timeout.refresh() | |
| 31196 | + } | |
| 31197 | + } | |
| 31198 | + | |
| 31199 | + resume(client) | |
| 31200 | + } | |
| 31201 | + | |
| 31202 | + destroy (err) { | |
| 31203 | + const { socket, client } = this | |
| 31204 | + | |
| 31205 | + socket[kWriting] = false | |
| 31206 | + | |
| 31207 | + if (err) { | |
| 31208 | + assert(client[kRunning] <= 1, 'pipeline should only contain this request') | |
| 31209 | + util.destroy(socket, err) | |
| 31210 | + } | |
| 31211 | + } | |
| 31212 | +} | |
| 31213 | + | |
| 31214 | +function errorRequest (client, request, err) { | |
| 31215 | + try { | |
| 31216 | + request.onError(err) | |
| 31217 | + assert(request.aborted) | |
| 31218 | + } catch (err) { | |
| 31219 | + client.emit('error', err) | |
| 31220 | + } | |
| 31221 | +} | |
| 31222 | + | |
| 31223 | +module.exports = Client | |
| 31224 | + | |
| 31225 | + | |
| 31226 | +/***/ }), | |
| 31227 | + | |
| 31228 | +/***/ 3194: | |
| 31229 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 31230 | + | |
| 31231 | +"use strict"; | |
| 31232 | + | |
| 31233 | + | |
| 31234 | +/* istanbul ignore file: only for Node 12 */ | |
| 31235 | + | |
| 31236 | +const { kConnected, kSize } = __nccwpck_require__(6443) | |
| 31237 | + | |
| 31238 | +class CompatWeakRef { | |
| 31239 | + constructor (value) { | |
| 31240 | + this.value = value | |
| 31241 | + } | |
| 31242 | + | |
| 31243 | + deref () { | |
| 31244 | + return this.value[kConnected] === 0 && this.value[kSize] === 0 | |
| 31245 | + ? undefined | |
| 31246 | + : this.value | |
| 31247 | + } | |
| 31248 | +} | |
| 31249 | + | |
| 31250 | +class CompatFinalizer { | |
| 31251 | + constructor (finalizer) { | |
| 31252 | + this.finalizer = finalizer | |
| 31253 | + } | |
| 31254 | + | |
| 31255 | + register (dispatcher, key) { | |
| 31256 | + if (dispatcher.on) { | |
| 31257 | + dispatcher.on('disconnect', () => { | |
| 31258 | + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { | |
| 31259 | + this.finalizer(key) | |
| 31260 | + } | |
| 31261 | + }) | |
| 31262 | + } | |
| 31263 | + } | |
| 31264 | +} | |
| 31265 | + | |
| 31266 | +module.exports = function () { | |
| 31267 | + // FIXME: remove workaround when the Node bug is fixed | |
| 31268 | + // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 | |
| 31269 | + if (process.env.NODE_V8_COVERAGE) { | |
| 31270 | + return { | |
| 31271 | + WeakRef: CompatWeakRef, | |
| 31272 | + FinalizationRegistry: CompatFinalizer | |
| 31273 | + } | |
| 31274 | + } | |
| 31275 | + return { | |
| 31276 | + WeakRef: global.WeakRef || CompatWeakRef, | |
| 31277 | + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer | |
| 31278 | + } | |
| 31279 | +} | |
| 31280 | + | |
| 31281 | + | |
| 31282 | +/***/ }), | |
| 31283 | + | |
| 31284 | +/***/ 9237: | |
| 31285 | +/***/ ((module) => { | |
| 31286 | + | |
| 31287 | +"use strict"; | |
| 31288 | + | |
| 31289 | + | |
| 31290 | +// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size | |
| 31291 | +const maxAttributeValueSize = 1024 | |
| 31292 | + | |
| 31293 | +// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size | |
| 31294 | +const maxNameValuePairSize = 4096 | |
| 31295 | + | |
| 31296 | +module.exports = { | |
| 31297 | + maxAttributeValueSize, | |
| 31298 | + maxNameValuePairSize | |
| 31299 | +} | |
| 31300 | + | |
| 31301 | + | |
| 31302 | +/***/ }), | |
| 31303 | + | |
| 31304 | +/***/ 3168: | |
| 31305 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 31306 | + | |
| 31307 | +"use strict"; | |
| 31308 | + | |
| 31309 | + | |
| 31310 | +const { parseSetCookie } = __nccwpck_require__(8915) | |
| 31311 | +const { stringify } = __nccwpck_require__(3834) | |
| 31312 | +const { webidl } = __nccwpck_require__(4222) | |
| 31313 | +const { Headers } = __nccwpck_require__(6349) | |
| 31314 | + | |
| 31315 | +/** | |
| 31316 | + * @typedef {Object} Cookie | |
| 31317 | + * @property {string} name | |
| 31318 | + * @property {string} value | |
| 31319 | + * @property {Date|number|undefined} expires | |
| 31320 | + * @property {number|undefined} maxAge | |
| 31321 | + * @property {string|undefined} domain | |
| 31322 | + * @property {string|undefined} path | |
| 31323 | + * @property {boolean|undefined} secure | |
| 31324 | + * @property {boolean|undefined} httpOnly | |
| 31325 | + * @property {'Strict'|'Lax'|'None'} sameSite | |
| 31326 | + * @property {string[]} unparsed | |
| 31327 | + */ | |
| 31328 | + | |
| 31329 | +/** | |
| 31330 | + * @param {Headers} headers | |
| 31331 | + * @returns {Record<string, string>} | |
| 31332 | + */ | |
| 31333 | +function getCookies (headers) { | |
| 31334 | + webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) | |
| 31335 | + | |
| 31336 | + webidl.brandCheck(headers, Headers, { strict: false }) | |
| 31337 | + | |
| 31338 | + const cookie = headers.get('cookie') | |
| 31339 | + const out = {} | |
| 31340 | + | |
| 31341 | + if (!cookie) { | |
| 31342 | + return out | |
| 31343 | + } | |
| 31344 | + | |
| 31345 | + for (const piece of cookie.split(';')) { | |
| 31346 | + const [name, ...value] = piece.split('=') | |
| 31347 | + | |
| 31348 | + out[name.trim()] = value.join('=') | |
| 31349 | + } | |
| 31350 | + | |
| 31351 | + return out | |
| 31352 | +} | |
| 31353 | + | |
| 31354 | +/** | |
| 31355 | + * @param {Headers} headers | |
| 31356 | + * @param {string} name | |
| 31357 | + * @param {{ path?: string, domain?: string }|undefined} attributes | |
| 31358 | + * @returns {void} | |
| 31359 | + */ | |
| 31360 | +function deleteCookie (headers, name, attributes) { | |
| 31361 | + webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) | |
| 31362 | + | |
| 31363 | + webidl.brandCheck(headers, Headers, { strict: false }) | |
| 31364 | + | |
| 31365 | + name = webidl.converters.DOMString(name) | |
| 31366 | + attributes = webidl.converters.DeleteCookieAttributes(attributes) | |
| 31367 | + | |
| 31368 | + // Matches behavior of | |
| 31369 | + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 | |
| 31370 | + setCookie(headers, { | |
| 31371 | + name, | |
| 31372 | + value: '', | |
| 31373 | + expires: new Date(0), | |
| 31374 | + ...attributes | |
| 31375 | + }) | |
| 31376 | +} | |
| 31377 | + | |
| 31378 | +/** | |
| 31379 | + * @param {Headers} headers | |
| 31380 | + * @returns {Cookie[]} | |
| 31381 | + */ | |
| 31382 | +function getSetCookies (headers) { | |
| 31383 | + webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) | |
| 31384 | + | |
| 31385 | + webidl.brandCheck(headers, Headers, { strict: false }) | |
| 31386 | + | |
| 31387 | + const cookies = headers.getSetCookie() | |
| 31388 | + | |
| 31389 | + if (!cookies) { | |
| 31390 | + return [] | |
| 31391 | + } | |
| 31392 | + | |
| 31393 | + return cookies.map((pair) => parseSetCookie(pair)) | |
| 31394 | +} | |
| 31395 | + | |
| 31396 | +/** | |
| 31397 | + * @param {Headers} headers | |
| 31398 | + * @param {Cookie} cookie | |
| 31399 | + * @returns {void} | |
| 31400 | + */ | |
| 31401 | +function setCookie (headers, cookie) { | |
| 31402 | + webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) | |
| 31403 | + | |
| 31404 | + webidl.brandCheck(headers, Headers, { strict: false }) | |
| 31405 | + | |
| 31406 | + cookie = webidl.converters.Cookie(cookie) | |
| 31407 | + | |
| 31408 | + const str = stringify(cookie) | |
| 31409 | + | |
| 31410 | + if (str) { | |
| 31411 | + headers.append('Set-Cookie', stringify(cookie)) | |
| 31412 | + } | |
| 31413 | +} | |
| 31414 | + | |
| 31415 | +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ | |
| 31416 | + { | |
| 31417 | + converter: webidl.nullableConverter(webidl.converters.DOMString), | |
| 31418 | + key: 'path', | |
| 31419 | + defaultValue: null | |
| 31420 | + }, | |
| 31421 | + { | |
| 31422 | + converter: webidl.nullableConverter(webidl.converters.DOMString), | |
| 31423 | + key: 'domain', | |
| 31424 | + defaultValue: null | |
| 31425 | + } | |
| 31426 | +]) | |
| 31427 | + | |
| 31428 | +webidl.converters.Cookie = webidl.dictionaryConverter([ | |
| 31429 | + { | |
| 31430 | + converter: webidl.converters.DOMString, | |
| 31431 | + key: 'name' | |
| 31432 | + }, | |
| 31433 | + { | |
| 31434 | + converter: webidl.converters.DOMString, | |
| 31435 | + key: 'value' | |
| 31436 | + }, | |
| 31437 | + { | |
| 31438 | + converter: webidl.nullableConverter((value) => { | |
| 31439 | + if (typeof value === 'number') { | |
| 31440 | + return webidl.converters['unsigned long long'](value) | |
| 31441 | + } | |
| 31442 | + | |
| 31443 | + return new Date(value) | |
| 31444 | + }), | |
| 31445 | + key: 'expires', | |
| 31446 | + defaultValue: null | |
| 31447 | + }, | |
| 31448 | + { | |
| 31449 | + converter: webidl.nullableConverter(webidl.converters['long long']), | |
| 31450 | + key: 'maxAge', | |
| 31451 | + defaultValue: null | |
| 31452 | + }, | |
| 31453 | + { | |
| 31454 | + converter: webidl.nullableConverter(webidl.converters.DOMString), | |
| 31455 | + key: 'domain', | |
| 31456 | + defaultValue: null | |
| 31457 | + }, | |
| 31458 | + { | |
| 31459 | + converter: webidl.nullableConverter(webidl.converters.DOMString), | |
| 31460 | + key: 'path', | |
| 31461 | + defaultValue: null | |
| 31462 | + }, | |
| 31463 | + { | |
| 31464 | + converter: webidl.nullableConverter(webidl.converters.boolean), | |
| 31465 | + key: 'secure', | |
| 31466 | + defaultValue: null | |
| 31467 | + }, | |
| 31468 | + { | |
| 31469 | + converter: webidl.nullableConverter(webidl.converters.boolean), | |
| 31470 | + key: 'httpOnly', | |
| 31471 | + defaultValue: null | |
| 31472 | + }, | |
| 31473 | + { | |
| 31474 | + converter: webidl.converters.USVString, | |
| 31475 | + key: 'sameSite', | |
| 31476 | + allowedValues: ['Strict', 'Lax', 'None'] | |
| 31477 | + }, | |
| 31478 | + { | |
| 31479 | + converter: webidl.sequenceConverter(webidl.converters.DOMString), | |
| 31480 | + key: 'unparsed', | |
| 31481 | + defaultValue: [] | |
| 31482 | + } | |
| 31483 | +]) | |
| 31484 | + | |
| 31485 | +module.exports = { | |
| 31486 | + getCookies, | |
| 31487 | + deleteCookie, | |
| 31488 | + getSetCookies, | |
| 31489 | + setCookie | |
| 31490 | +} | |
| 31491 | + | |
| 31492 | + | |
| 31493 | +/***/ }), | |
| 31494 | + | |
| 31495 | +/***/ 8915: | |
| 31496 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 31497 | + | |
| 31498 | +"use strict"; | |
| 31499 | + | |
| 31500 | + | |
| 31501 | +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(9237) | |
| 31502 | +const { isCTLExcludingHtab } = __nccwpck_require__(3834) | |
| 31503 | +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4322) | |
| 31504 | +const assert = __nccwpck_require__(2613) | |
| 31505 | + | |
| 31506 | +/** | |
| 31507 | + * @description Parses the field-value attributes of a set-cookie header string. | |
| 31508 | + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 | |
| 31509 | + * @param {string} header | |
| 31510 | + * @returns if the header is invalid, null will be returned | |
| 31511 | + */ | |
| 31512 | +function parseSetCookie (header) { | |
| 31513 | + // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F | |
| 31514 | + // character (CTL characters excluding HTAB): Abort these steps and | |
| 31515 | + // ignore the set-cookie-string entirely. | |
| 31516 | + if (isCTLExcludingHtab(header)) { | |
| 31517 | + return null | |
| 31518 | + } | |
| 31519 | + | |
| 31520 | + let nameValuePair = '' | |
| 31521 | + let unparsedAttributes = '' | |
| 31522 | + let name = '' | |
| 31523 | + let value = '' | |
| 31524 | + | |
| 31525 | + // 2. If the set-cookie-string contains a %x3B (";") character: | |
| 31526 | + if (header.includes(';')) { | |
| 31527 | + // 1. The name-value-pair string consists of the characters up to, | |
| 31528 | + // but not including, the first %x3B (";"), and the unparsed- | |
| 31529 | + // attributes consist of the remainder of the set-cookie-string | |
| 31530 | + // (including the %x3B (";") in question). | |
| 31531 | + const position = { position: 0 } | |
| 31532 | + | |
| 31533 | + nameValuePair = collectASequenceOfCodePointsFast(';', header, position) | |
| 31534 | + unparsedAttributes = header.slice(position.position) | |
| 31535 | + } else { | |
| 31536 | + // Otherwise: | |
| 31537 | + | |
| 31538 | + // 1. The name-value-pair string consists of all the characters | |
| 31539 | + // contained in the set-cookie-string, and the unparsed- | |
| 31540 | + // attributes is the empty string. | |
| 31541 | + nameValuePair = header | |
| 31542 | + } | |
| 31543 | + | |
| 31544 | + // 3. If the name-value-pair string lacks a %x3D ("=") character, then | |
| 31545 | + // the name string is empty, and the value string is the value of | |
| 31546 | + // name-value-pair. | |
| 31547 | + if (!nameValuePair.includes('=')) { | |
| 31548 | + value = nameValuePair | |
| 31549 | + } else { | |
| 31550 | + // Otherwise, the name string consists of the characters up to, but | |
| 31551 | + // not including, the first %x3D ("=") character, and the (possibly | |
| 31552 | + // empty) value string consists of the characters after the first | |
| 31553 | + // %x3D ("=") character. | |
| 31554 | + const position = { position: 0 } | |
| 31555 | + name = collectASequenceOfCodePointsFast( | |
| 31556 | + '=', | |
| 31557 | + nameValuePair, | |
| 31558 | + position | |
| 31559 | + ) | |
| 31560 | + value = nameValuePair.slice(position.position + 1) | |
| 31561 | + } | |
| 31562 | + | |
| 31563 | + // 4. Remove any leading or trailing WSP characters from the name | |
| 31564 | + // string and the value string. | |
| 31565 | + name = name.trim() | |
| 31566 | + value = value.trim() | |
| 31567 | + | |
| 31568 | + // 5. If the sum of the lengths of the name string and the value string | |
| 31569 | + // is more than 4096 octets, abort these steps and ignore the set- | |
| 31570 | + // cookie-string entirely. | |
| 31571 | + if (name.length + value.length > maxNameValuePairSize) { | |
| 31572 | + return null | |
| 31573 | + } | |
| 31574 | + | |
| 31575 | + // 6. The cookie-name is the name string, and the cookie-value is the | |
| 31576 | + // value string. | |
| 31577 | + return { | |
| 31578 | + name, value, ...parseUnparsedAttributes(unparsedAttributes) | |
| 31579 | + } | |
| 31580 | +} | |
| 31581 | + | |
| 31582 | +/** | |
| 31583 | + * Parses the remaining attributes of a set-cookie header | |
| 31584 | + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 | |
| 31585 | + * @param {string} unparsedAttributes | |
| 31586 | + * @param {[Object.<string, unknown>]={}} cookieAttributeList | |
| 31587 | + */ | |
| 31588 | +function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { | |
| 31589 | + // 1. If the unparsed-attributes string is empty, skip the rest of | |
| 31590 | + // these steps. | |
| 31591 | + if (unparsedAttributes.length === 0) { | |
| 31592 | + return cookieAttributeList | |
| 31593 | + } | |
| 31594 | + | |
| 31595 | + // 2. Discard the first character of the unparsed-attributes (which | |
| 31596 | + // will be a %x3B (";") character). | |
| 31597 | + assert(unparsedAttributes[0] === ';') | |
| 31598 | + unparsedAttributes = unparsedAttributes.slice(1) | |
| 31599 | + | |
| 31600 | + let cookieAv = '' | |
| 31601 | + | |
| 31602 | + // 3. If the remaining unparsed-attributes contains a %x3B (";") | |
| 31603 | + // character: | |
| 31604 | + if (unparsedAttributes.includes(';')) { | |
| 31605 | + // 1. Consume the characters of the unparsed-attributes up to, but | |
| 31606 | + // not including, the first %x3B (";") character. | |
| 31607 | + cookieAv = collectASequenceOfCodePointsFast( | |
| 31608 | + ';', | |
| 31609 | + unparsedAttributes, | |
| 31610 | + { position: 0 } | |
| 31611 | + ) | |
| 31612 | + unparsedAttributes = unparsedAttributes.slice(cookieAv.length) | |
| 31613 | + } else { | |
| 31614 | + // Otherwise: | |
| 31615 | + | |
| 31616 | + // 1. Consume the remainder of the unparsed-attributes. | |
| 31617 | + cookieAv = unparsedAttributes | |
| 31618 | + unparsedAttributes = '' | |
| 31619 | + } | |
| 31620 | + | |
| 31621 | + // Let the cookie-av string be the characters consumed in this step. | |
| 31622 | + | |
| 31623 | + let attributeName = '' | |
| 31624 | + let attributeValue = '' | |
| 31625 | + | |
| 31626 | + // 4. If the cookie-av string contains a %x3D ("=") character: | |
| 31627 | + if (cookieAv.includes('=')) { | |
| 31628 | + // 1. The (possibly empty) attribute-name string consists of the | |
| 31629 | + // characters up to, but not including, the first %x3D ("=") | |
| 31630 | + // character, and the (possibly empty) attribute-value string | |
| 31631 | + // consists of the characters after the first %x3D ("=") | |
| 31632 | + // character. | |
| 31633 | + const position = { position: 0 } | |
| 31634 | + | |
| 31635 | + attributeName = collectASequenceOfCodePointsFast( | |
| 31636 | + '=', | |
| 31637 | + cookieAv, | |
| 31638 | + position | |
| 31639 | + ) | |
| 31640 | + attributeValue = cookieAv.slice(position.position + 1) | |
| 31641 | + } else { | |
| 31642 | + // Otherwise: | |
| 31643 | + | |
| 31644 | + // 1. The attribute-name string consists of the entire cookie-av | |
| 31645 | + // string, and the attribute-value string is empty. | |
| 31646 | + attributeName = cookieAv | |
| 31647 | + } | |
| 31648 | + | |
| 31649 | + // 5. Remove any leading or trailing WSP characters from the attribute- | |
| 31650 | + // name string and the attribute-value string. | |
| 31651 | + attributeName = attributeName.trim() | |
| 31652 | + attributeValue = attributeValue.trim() | |
| 31653 | + | |
| 31654 | + // 6. If the attribute-value is longer than 1024 octets, ignore the | |
| 31655 | + // cookie-av string and return to Step 1 of this algorithm. | |
| 31656 | + if (attributeValue.length > maxAttributeValueSize) { | |
| 31657 | + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) | |
| 31658 | + } | |
| 31659 | + | |
| 31660 | + // 7. Process the attribute-name and attribute-value according to the | |
| 31661 | + // requirements in the following subsections. (Notice that | |
| 31662 | + // attributes with unrecognized attribute-names are ignored.) | |
| 31663 | + const attributeNameLowercase = attributeName.toLowerCase() | |
| 31664 | + | |
| 31665 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 | |
| 31666 | + // If the attribute-name case-insensitively matches the string | |
| 31667 | + // "Expires", the user agent MUST process the cookie-av as follows. | |
| 31668 | + if (attributeNameLowercase === 'expires') { | |
| 31669 | + // 1. Let the expiry-time be the result of parsing the attribute-value | |
| 31670 | + // as cookie-date (see Section 5.1.1). | |
| 31671 | + const expiryTime = new Date(attributeValue) | |
| 31672 | + | |
| 31673 | + // 2. If the attribute-value failed to parse as a cookie date, ignore | |
| 31674 | + // the cookie-av. | |
| 31675 | + | |
| 31676 | + cookieAttributeList.expires = expiryTime | |
| 31677 | + } else if (attributeNameLowercase === 'max-age') { | |
| 31678 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 | |
| 31679 | + // If the attribute-name case-insensitively matches the string "Max- | |
| 31680 | + // Age", the user agent MUST process the cookie-av as follows. | |
| 31681 | + | |
| 31682 | + // 1. If the first character of the attribute-value is not a DIGIT or a | |
| 31683 | + // "-" character, ignore the cookie-av. | |
| 31684 | + const charCode = attributeValue.charCodeAt(0) | |
| 31685 | + | |
| 31686 | + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { | |
| 31687 | + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) | |
| 31688 | + } | |
| 31689 | + | |
| 31690 | + // 2. If the remainder of attribute-value contains a non-DIGIT | |
| 31691 | + // character, ignore the cookie-av. | |
| 31692 | + if (!/^\d+$/.test(attributeValue)) { | |
| 31693 | + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) | |
| 31694 | + } | |
| 31695 | + | |
| 31696 | + // 3. Let delta-seconds be the attribute-value converted to an integer. | |
| 31697 | + const deltaSeconds = Number(attributeValue) | |
| 31698 | + | |
| 31699 | + // 4. Let cookie-age-limit be the maximum age of the cookie (which | |
| 31700 | + // SHOULD be 400 days or less, see Section 4.1.2.2). | |
| 31701 | + | |
| 31702 | + // 5. Set delta-seconds to the smaller of its present value and cookie- | |
| 31703 | + // age-limit. | |
| 31704 | + // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) | |
| 31705 | + | |
| 31706 | + // 6. If delta-seconds is less than or equal to zero (0), let expiry- | |
| 31707 | + // time be the earliest representable date and time. Otherwise, let | |
| 31708 | + // the expiry-time be the current date and time plus delta-seconds | |
| 31709 | + // seconds. | |
| 31710 | + // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds | |
| 31711 | + | |
| 31712 | + // 7. Append an attribute to the cookie-attribute-list with an | |
| 31713 | + // attribute-name of Max-Age and an attribute-value of expiry-time. | |
| 31714 | + cookieAttributeList.maxAge = deltaSeconds | |
| 31715 | + } else if (attributeNameLowercase === 'domain') { | |
| 31716 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 | |
| 31717 | + // If the attribute-name case-insensitively matches the string "Domain", | |
| 31718 | + // the user agent MUST process the cookie-av as follows. | |
| 31719 | + | |
| 31720 | + // 1. Let cookie-domain be the attribute-value. | |
| 31721 | + let cookieDomain = attributeValue | |
| 31722 | + | |
| 31723 | + // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be | |
| 31724 | + // cookie-domain without its leading %x2E ("."). | |
| 31725 | + if (cookieDomain[0] === '.') { | |
| 31726 | + cookieDomain = cookieDomain.slice(1) | |
| 31727 | + } | |
| 31728 | + | |
| 31729 | + // 3. Convert the cookie-domain to lower case. | |
| 31730 | + cookieDomain = cookieDomain.toLowerCase() | |
| 31731 | + | |
| 31732 | + // 4. Append an attribute to the cookie-attribute-list with an | |
| 31733 | + // attribute-name of Domain and an attribute-value of cookie-domain. | |
| 31734 | + cookieAttributeList.domain = cookieDomain | |
| 31735 | + } else if (attributeNameLowercase === 'path') { | |
| 31736 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 | |
| 31737 | + // If the attribute-name case-insensitively matches the string "Path", | |
| 31738 | + // the user agent MUST process the cookie-av as follows. | |
| 31739 | + | |
| 31740 | + // 1. If the attribute-value is empty or if the first character of the | |
| 31741 | + // attribute-value is not %x2F ("/"): | |
| 31742 | + let cookiePath = '' | |
| 31743 | + if (attributeValue.length === 0 || attributeValue[0] !== '/') { | |
| 31744 | + // 1. Let cookie-path be the default-path. | |
| 31745 | + cookiePath = '/' | |
| 31746 | + } else { | |
| 31747 | + // Otherwise: | |
| 31748 | + | |
| 31749 | + // 1. Let cookie-path be the attribute-value. | |
| 31750 | + cookiePath = attributeValue | |
| 31751 | + } | |
| 31752 | + | |
| 31753 | + // 2. Append an attribute to the cookie-attribute-list with an | |
| 31754 | + // attribute-name of Path and an attribute-value of cookie-path. | |
| 31755 | + cookieAttributeList.path = cookiePath | |
| 31756 | + } else if (attributeNameLowercase === 'secure') { | |
| 31757 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 | |
| 31758 | + // If the attribute-name case-insensitively matches the string "Secure", | |
| 31759 | + // the user agent MUST append an attribute to the cookie-attribute-list | |
| 31760 | + // with an attribute-name of Secure and an empty attribute-value. | |
| 31761 | + | |
| 31762 | + cookieAttributeList.secure = true | |
| 31763 | + } else if (attributeNameLowercase === 'httponly') { | |
| 31764 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 | |
| 31765 | + // If the attribute-name case-insensitively matches the string | |
| 31766 | + // "HttpOnly", the user agent MUST append an attribute to the cookie- | |
| 31767 | + // attribute-list with an attribute-name of HttpOnly and an empty | |
| 31768 | + // attribute-value. | |
| 31769 | + | |
| 31770 | + cookieAttributeList.httpOnly = true | |
| 31771 | + } else if (attributeNameLowercase === 'samesite') { | |
| 31772 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 | |
| 31773 | + // If the attribute-name case-insensitively matches the string | |
| 31774 | + // "SameSite", the user agent MUST process the cookie-av as follows: | |
| 31775 | + | |
| 31776 | + // 1. Let enforcement be "Default". | |
| 31777 | + let enforcement = 'Default' | |
| 31778 | + | |
| 31779 | + const attributeValueLowercase = attributeValue.toLowerCase() | |
| 31780 | + // 2. If cookie-av's attribute-value is a case-insensitive match for | |
| 31781 | + // "None", set enforcement to "None". | |
| 31782 | + if (attributeValueLowercase.includes('none')) { | |
| 31783 | + enforcement = 'None' | |
| 31784 | + } | |
| 31785 | + | |
| 31786 | + // 3. If cookie-av's attribute-value is a case-insensitive match for | |
| 31787 | + // "Strict", set enforcement to "Strict". | |
| 31788 | + if (attributeValueLowercase.includes('strict')) { | |
| 31789 | + enforcement = 'Strict' | |
| 31790 | + } | |
| 31791 | + | |
| 31792 | + // 4. If cookie-av's attribute-value is a case-insensitive match for | |
| 31793 | + // "Lax", set enforcement to "Lax". | |
| 31794 | + if (attributeValueLowercase.includes('lax')) { | |
| 31795 | + enforcement = 'Lax' | |
| 31796 | + } | |
| 31797 | + | |
| 31798 | + // 5. Append an attribute to the cookie-attribute-list with an | |
| 31799 | + // attribute-name of "SameSite" and an attribute-value of | |
| 31800 | + // enforcement. | |
| 31801 | + cookieAttributeList.sameSite = enforcement | |
| 31802 | + } else { | |
| 31803 | + cookieAttributeList.unparsed ??= [] | |
| 31804 | + | |
| 31805 | + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) | |
| 31806 | + } | |
| 31807 | + | |
| 31808 | + // 8. Return to Step 1 of this algorithm. | |
| 31809 | + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) | |
| 31810 | +} | |
| 31811 | + | |
| 31812 | +module.exports = { | |
| 31813 | + parseSetCookie, | |
| 31814 | + parseUnparsedAttributes | |
| 31815 | +} | |
| 31816 | + | |
| 31817 | + | |
| 31818 | +/***/ }), | |
| 31819 | + | |
| 31820 | +/***/ 3834: | |
| 31821 | +/***/ ((module) => { | |
| 31822 | + | |
| 31823 | +"use strict"; | |
| 31824 | + | |
| 31825 | + | |
| 31826 | +/** | |
| 31827 | + * @param {string} value | |
| 31828 | + * @returns {boolean} | |
| 31829 | + */ | |
| 31830 | +function isCTLExcludingHtab (value) { | |
| 31831 | + if (value.length === 0) { | |
| 31832 | + return false | |
| 31833 | + } | |
| 31834 | + | |
| 31835 | + for (const char of value) { | |
| 31836 | + const code = char.charCodeAt(0) | |
| 31837 | + | |
| 31838 | + if ( | |
| 31839 | + (code >= 0x00 || code <= 0x08) || | |
| 31840 | + (code >= 0x0A || code <= 0x1F) || | |
| 31841 | + code === 0x7F | |
| 31842 | + ) { | |
| 31843 | + return false | |
| 31844 | + } | |
| 31845 | + } | |
| 31846 | +} | |
| 31847 | + | |
| 31848 | +/** | |
| 31849 | + CHAR = <any US-ASCII character (octets 0 - 127)> | |
| 31850 | + token = 1*<any CHAR except CTLs or separators> | |
| 31851 | + separators = "(" | ")" | "<" | ">" | "@" | |
| 31852 | + | "," | ";" | ":" | "\" | <"> | |
| 31853 | + | "/" | "[" | "]" | "?" | "=" | |
| 31854 | + | "{" | "}" | SP | HT | |
| 31855 | + * @param {string} name | |
| 31856 | + */ | |
| 31857 | +function validateCookieName (name) { | |
| 31858 | + for (const char of name) { | |
| 31859 | + const code = char.charCodeAt(0) | |
| 31860 | + | |
| 31861 | + if ( | |
| 31862 | + (code <= 0x20 || code > 0x7F) || | |
| 31863 | + char === '(' || | |
| 31864 | + char === ')' || | |
| 31865 | + char === '>' || | |
| 31866 | + char === '<' || | |
| 31867 | + char === '@' || | |
| 31868 | + char === ',' || | |
| 31869 | + char === ';' || | |
| 31870 | + char === ':' || | |
| 31871 | + char === '\\' || | |
| 31872 | + char === '"' || | |
| 31873 | + char === '/' || | |
| 31874 | + char === '[' || | |
| 31875 | + char === ']' || | |
| 31876 | + char === '?' || | |
| 31877 | + char === '=' || | |
| 31878 | + char === '{' || | |
| 31879 | + char === '}' | |
| 31880 | + ) { | |
| 31881 | + throw new Error('Invalid cookie name') | |
| 31882 | + } | |
| 31883 | + } | |
| 31884 | +} | |
| 31885 | + | |
| 31886 | +/** | |
| 31887 | + cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) | |
| 31888 | + cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E | |
| 31889 | + ; US-ASCII characters excluding CTLs, | |
| 31890 | + ; whitespace DQUOTE, comma, semicolon, | |
| 31891 | + ; and backslash | |
| 31892 | + * @param {string} value | |
| 31893 | + */ | |
| 31894 | +function validateCookieValue (value) { | |
| 31895 | + for (const char of value) { | |
| 31896 | + const code = char.charCodeAt(0) | |
| 31897 | + | |
| 31898 | + if ( | |
| 31899 | + code < 0x21 || // exclude CTLs (0-31) | |
| 31900 | + code === 0x22 || | |
| 31901 | + code === 0x2C || | |
| 31902 | + code === 0x3B || | |
| 31903 | + code === 0x5C || | |
| 31904 | + code > 0x7E // non-ascii | |
| 31905 | + ) { | |
| 31906 | + throw new Error('Invalid header value') | |
| 31907 | + } | |
| 31908 | + } | |
| 31909 | +} | |
| 31910 | + | |
| 31911 | +/** | |
| 31912 | + * path-value = <any CHAR except CTLs or ";"> | |
| 31913 | + * @param {string} path | |
| 31914 | + */ | |
| 31915 | +function validateCookiePath (path) { | |
| 31916 | + for (const char of path) { | |
| 31917 | + const code = char.charCodeAt(0) | |
| 31918 | + | |
| 31919 | + if (code < 0x21 || char === ';') { | |
| 31920 | + throw new Error('Invalid cookie path') | |
| 31921 | + } | |
| 31922 | + } | |
| 31923 | +} | |
| 31924 | + | |
| 31925 | +/** | |
| 31926 | + * I have no idea why these values aren't allowed to be honest, | |
| 31927 | + * but Deno tests these. - Khafra | |
| 31928 | + * @param {string} domain | |
| 31929 | + */ | |
| 31930 | +function validateCookieDomain (domain) { | |
| 31931 | + if ( | |
| 31932 | + domain.startsWith('-') || | |
| 31933 | + domain.endsWith('.') || | |
| 31934 | + domain.endsWith('-') | |
| 31935 | + ) { | |
| 31936 | + throw new Error('Invalid cookie domain') | |
| 31937 | + } | |
| 31938 | +} | |
| 31939 | + | |
| 31940 | +/** | |
| 31941 | + * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 | |
| 31942 | + * @param {number|Date} date | |
| 31943 | + IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT | |
| 31944 | + ; fixed length/zone/capitalization subset of the format | |
| 31945 | + ; see Section 3.3 of [RFC5322] | |
| 31946 | + | |
| 31947 | + day-name = %x4D.6F.6E ; "Mon", case-sensitive | |
| 31948 | + / %x54.75.65 ; "Tue", case-sensitive | |
| 31949 | + / %x57.65.64 ; "Wed", case-sensitive | |
| 31950 | + / %x54.68.75 ; "Thu", case-sensitive | |
| 31951 | + / %x46.72.69 ; "Fri", case-sensitive | |
| 31952 | + / %x53.61.74 ; "Sat", case-sensitive | |
| 31953 | + / %x53.75.6E ; "Sun", case-sensitive | |
| 31954 | + date1 = day SP month SP year | |
| 31955 | + ; e.g., 02 Jun 1982 | |
| 31956 | + | |
| 31957 | + day = 2DIGIT | |
| 31958 | + month = %x4A.61.6E ; "Jan", case-sensitive | |
| 31959 | + / %x46.65.62 ; "Feb", case-sensitive | |
| 31960 | + / %x4D.61.72 ; "Mar", case-sensitive | |
| 31961 | + / %x41.70.72 ; "Apr", case-sensitive | |
| 31962 | + / %x4D.61.79 ; "May", case-sensitive | |
| 31963 | + / %x4A.75.6E ; "Jun", case-sensitive | |
| 31964 | + / %x4A.75.6C ; "Jul", case-sensitive | |
| 31965 | + / %x41.75.67 ; "Aug", case-sensitive | |
| 31966 | + / %x53.65.70 ; "Sep", case-sensitive | |
| 31967 | + / %x4F.63.74 ; "Oct", case-sensitive | |
| 31968 | + / %x4E.6F.76 ; "Nov", case-sensitive | |
| 31969 | + / %x44.65.63 ; "Dec", case-sensitive | |
| 31970 | + year = 4DIGIT | |
| 31971 | + | |
| 31972 | + GMT = %x47.4D.54 ; "GMT", case-sensitive | |
| 31973 | + | |
| 31974 | + time-of-day = hour ":" minute ":" second | |
| 31975 | + ; 00:00:00 - 23:59:60 (leap second) | |
| 31976 | + | |
| 31977 | + hour = 2DIGIT | |
| 31978 | + minute = 2DIGIT | |
| 31979 | + second = 2DIGIT | |
| 31980 | + */ | |
| 31981 | +function toIMFDate (date) { | |
| 31982 | + if (typeof date === 'number') { | |
| 31983 | + date = new Date(date) | |
| 31984 | + } | |
| 31985 | + | |
| 31986 | + const days = [ | |
| 31987 | + 'Sun', 'Mon', 'Tue', 'Wed', | |
| 31988 | + 'Thu', 'Fri', 'Sat' | |
| 31989 | + ] | |
| 31990 | + | |
| 31991 | + const months = [ | |
| 31992 | + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | |
| 31993 | + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' | |
| 31994 | + ] | |
| 31995 | + | |
| 31996 | + const dayName = days[date.getUTCDay()] | |
| 31997 | + const day = date.getUTCDate().toString().padStart(2, '0') | |
| 31998 | + const month = months[date.getUTCMonth()] | |
| 31999 | + const year = date.getUTCFullYear() | |
| 32000 | + const hour = date.getUTCHours().toString().padStart(2, '0') | |
| 32001 | + const minute = date.getUTCMinutes().toString().padStart(2, '0') | |
| 32002 | + const second = date.getUTCSeconds().toString().padStart(2, '0') | |
| 32003 | + | |
| 32004 | + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` | |
| 32005 | +} | |
| 32006 | + | |
| 32007 | +/** | |
| 32008 | + max-age-av = "Max-Age=" non-zero-digit *DIGIT | |
| 32009 | + ; In practice, both expires-av and max-age-av | |
| 32010 | + ; are limited to dates representable by the | |
| 32011 | + ; user agent. | |
| 32012 | + * @param {number} maxAge | |
| 32013 | + */ | |
| 32014 | +function validateCookieMaxAge (maxAge) { | |
| 32015 | + if (maxAge < 0) { | |
| 32016 | + throw new Error('Invalid cookie max-age') | |
| 32017 | + } | |
| 32018 | +} | |
| 32019 | + | |
| 32020 | +/** | |
| 32021 | + * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 | |
| 32022 | + * @param {import('./index').Cookie} cookie | |
| 32023 | + */ | |
| 32024 | +function stringify (cookie) { | |
| 32025 | + if (cookie.name.length === 0) { | |
| 32026 | + return null | |
| 32027 | + } | |
| 32028 | + | |
| 32029 | + validateCookieName(cookie.name) | |
| 32030 | + validateCookieValue(cookie.value) | |
| 32031 | + | |
| 32032 | + const out = [`${cookie.name}=${cookie.value}`] | |
| 32033 | + | |
| 32034 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 | |
| 32035 | + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 | |
| 32036 | + if (cookie.name.startsWith('__Secure-')) { | |
| 32037 | + cookie.secure = true | |
| 32038 | + } | |
| 32039 | + | |
| 32040 | + if (cookie.name.startsWith('__Host-')) { | |
| 32041 | + cookie.secure = true | |
| 32042 | + cookie.domain = null | |
| 32043 | + cookie.path = '/' | |
| 32044 | + } | |
| 32045 | + | |
| 32046 | + if (cookie.secure) { | |
| 32047 | + out.push('Secure') | |
| 32048 | + } | |
| 32049 | + | |
| 32050 | + if (cookie.httpOnly) { | |
| 32051 | + out.push('HttpOnly') | |
| 32052 | + } | |
| 32053 | + | |
| 32054 | + if (typeof cookie.maxAge === 'number') { | |
| 32055 | + validateCookieMaxAge(cookie.maxAge) | |
| 32056 | + out.push(`Max-Age=${cookie.maxAge}`) | |
| 32057 | + } | |
| 32058 | + | |
| 32059 | + if (cookie.domain) { | |
| 32060 | + validateCookieDomain(cookie.domain) | |
| 32061 | + out.push(`Domain=${cookie.domain}`) | |
| 32062 | + } | |
| 32063 | + | |
| 32064 | + if (cookie.path) { | |
| 32065 | + validateCookiePath(cookie.path) | |
| 32066 | + out.push(`Path=${cookie.path}`) | |
| 32067 | + } | |
| 32068 | + | |
| 32069 | + if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { | |
| 32070 | + out.push(`Expires=${toIMFDate(cookie.expires)}`) | |
| 32071 | + } | |
| 32072 | + | |
| 32073 | + if (cookie.sameSite) { | |
| 32074 | + out.push(`SameSite=${cookie.sameSite}`) | |
| 32075 | + } | |
| 32076 | + | |
| 32077 | + for (const part of cookie.unparsed) { | |
| 32078 | + if (!part.includes('=')) { | |
| 32079 | + throw new Error('Invalid unparsed') | |
| 32080 | + } | |
| 32081 | + | |
| 32082 | + const [key, ...value] = part.split('=') | |
| 32083 | + | |
| 32084 | + out.push(`${key.trim()}=${value.join('=')}`) | |
| 32085 | + } | |
| 32086 | + | |
| 32087 | + return out.join('; ') | |
| 32088 | +} | |
| 32089 | + | |
| 32090 | +module.exports = { | |
| 32091 | + isCTLExcludingHtab, | |
| 32092 | + validateCookieName, | |
| 32093 | + validateCookiePath, | |
| 32094 | + validateCookieValue, | |
| 32095 | + toIMFDate, | |
| 32096 | + stringify | |
| 32097 | +} | |
| 32098 | + | |
| 32099 | + | |
| 32100 | +/***/ }), | |
| 32101 | + | |
| 32102 | +/***/ 9136: | |
| 32103 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 32104 | + | |
| 32105 | +"use strict"; | |
| 32106 | + | |
| 32107 | + | |
| 32108 | +const net = __nccwpck_require__(9278) | |
| 32109 | +const assert = __nccwpck_require__(2613) | |
| 32110 | +const util = __nccwpck_require__(3440) | |
| 32111 | +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8707) | |
| 32112 | + | |
| 32113 | +let tls // include tls conditionally since it is not always available | |
| 32114 | + | |
| 32115 | +// TODO: session re-use does not wait for the first | |
| 32116 | +// connection to resolve the session and might therefore | |
| 32117 | +// resolve the same servername multiple times even when | |
| 32118 | +// re-use is enabled. | |
| 32119 | + | |
| 32120 | +let SessionCache | |
| 32121 | +// FIXME: remove workaround when the Node bug is fixed | |
| 32122 | +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 | |
| 32123 | +if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { | |
| 32124 | + SessionCache = class WeakSessionCache { | |
| 32125 | + constructor (maxCachedSessions) { | |
| 32126 | + this._maxCachedSessions = maxCachedSessions | |
| 32127 | + this._sessionCache = new Map() | |
| 32128 | + this._sessionRegistry = new global.FinalizationRegistry((key) => { | |
| 32129 | + if (this._sessionCache.size < this._maxCachedSessions) { | |
| 32130 | + return | |
| 32131 | + } | |
| 32132 | + | |
| 32133 | + const ref = this._sessionCache.get(key) | |
| 32134 | + if (ref !== undefined && ref.deref() === undefined) { | |
| 32135 | + this._sessionCache.delete(key) | |
| 32136 | + } | |
| 32137 | + }) | |
| 32138 | + } | |
| 32139 | + | |
| 32140 | + get (sessionKey) { | |
| 32141 | + const ref = this._sessionCache.get(sessionKey) | |
| 32142 | + return ref ? ref.deref() : null | |
| 32143 | + } | |
| 32144 | + | |
| 32145 | + set (sessionKey, session) { | |
| 32146 | + if (this._maxCachedSessions === 0) { | |
| 32147 | + return | |
| 32148 | + } | |
| 32149 | + | |
| 32150 | + this._sessionCache.set(sessionKey, new WeakRef(session)) | |
| 32151 | + this._sessionRegistry.register(session, sessionKey) | |
| 32152 | + } | |
| 32153 | + } | |
| 32154 | +} else { | |
| 32155 | + SessionCache = class SimpleSessionCache { | |
| 32156 | + constructor (maxCachedSessions) { | |
| 32157 | + this._maxCachedSessions = maxCachedSessions | |
| 32158 | + this._sessionCache = new Map() | |
| 32159 | + } | |
| 32160 | + | |
| 32161 | + get (sessionKey) { | |
| 32162 | + return this._sessionCache.get(sessionKey) | |
| 32163 | + } | |
| 32164 | + | |
| 32165 | + set (sessionKey, session) { | |
| 32166 | + if (this._maxCachedSessions === 0) { | |
| 32167 | + return | |
| 32168 | + } | |
| 32169 | + | |
| 32170 | + if (this._sessionCache.size >= this._maxCachedSessions) { | |
| 32171 | + // remove the oldest session | |
| 32172 | + const { value: oldestKey } = this._sessionCache.keys().next() | |
| 32173 | + this._sessionCache.delete(oldestKey) | |
| 32174 | + } | |
| 32175 | + | |
| 32176 | + this._sessionCache.set(sessionKey, session) | |
| 32177 | + } | |
| 32178 | + } | |
| 32179 | +} | |
| 32180 | + | |
| 32181 | +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { | |
| 32182 | + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { | |
| 32183 | + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') | |
| 32184 | + } | |
| 32185 | + | |
| 32186 | + const options = { path: socketPath, ...opts } | |
| 32187 | + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) | |
| 32188 | + timeout = timeout == null ? 10e3 : timeout | |
| 32189 | + allowH2 = allowH2 != null ? allowH2 : false | |
| 32190 | + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { | |
| 32191 | + let socket | |
| 32192 | + if (protocol === 'https:') { | |
| 32193 | + if (!tls) { | |
| 32194 | + tls = __nccwpck_require__(4756) | |
| 32195 | + } | |
| 32196 | + servername = servername || options.servername || util.getServerName(host) || null | |
| 32197 | + | |
| 32198 | + const sessionKey = servername || hostname | |
| 32199 | + const session = sessionCache.get(sessionKey) || null | |
| 32200 | + | |
| 32201 | + assert(sessionKey) | |
| 32202 | + | |
| 32203 | + socket = tls.connect({ | |
| 32204 | + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... | |
| 32205 | + ...options, | |
| 32206 | + servername, | |
| 32207 | + session, | |
| 32208 | + localAddress, | |
| 32209 | + // TODO(HTTP/2): Add support for h2c | |
| 32210 | + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], | |
| 32211 | + socket: httpSocket, // upgrade socket connection | |
| 32212 | + port: port || 443, | |
| 32213 | + host: hostname | |
| 32214 | + }) | |
| 32215 | + | |
| 32216 | + socket | |
| 32217 | + .on('session', function (session) { | |
| 32218 | + // TODO (fix): Can a session become invalid once established? Don't think so? | |
| 32219 | + sessionCache.set(sessionKey, session) | |
| 32220 | + }) | |
| 32221 | + } else { | |
| 32222 | + assert(!httpSocket, 'httpSocket can only be sent on TLS update') | |
| 32223 | + socket = net.connect({ | |
| 32224 | + highWaterMark: 64 * 1024, // Same as nodejs fs streams. | |
| 32225 | + ...options, | |
| 32226 | + localAddress, | |
| 32227 | + port: port || 80, | |
| 32228 | + host: hostname | |
| 32229 | + }) | |
| 32230 | + } | |
| 32231 | + | |
| 32232 | + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket | |
| 32233 | + if (options.keepAlive == null || options.keepAlive) { | |
| 32234 | + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay | |
| 32235 | + socket.setKeepAlive(true, keepAliveInitialDelay) | |
| 32236 | + } | |
| 32237 | + | |
| 32238 | + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) | |
| 32239 | + | |
| 32240 | + socket | |
| 32241 | + .setNoDelay(true) | |
| 32242 | + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { | |
| 32243 | + cancelTimeout() | |
| 32244 | + | |
| 32245 | + if (callback) { | |
| 32246 | + const cb = callback | |
| 32247 | + callback = null | |
| 32248 | + cb(null, this) | |
| 32249 | + } | |
| 32250 | + }) | |
| 32251 | + .on('error', function (err) { | |
| 32252 | + cancelTimeout() | |
| 32253 | + | |
| 32254 | + if (callback) { | |
| 32255 | + const cb = callback | |
| 32256 | + callback = null | |
| 32257 | + cb(err) | |
| 32258 | + } | |
| 32259 | + }) | |
| 32260 | + | |
| 32261 | + return socket | |
| 32262 | + } | |
| 32263 | +} | |
| 32264 | + | |
| 32265 | +function setupTimeout (onConnectTimeout, timeout) { | |
| 32266 | + if (!timeout) { | |
| 32267 | + return () => {} | |
| 32268 | + } | |
| 32269 | + | |
| 32270 | + let s1 = null | |
| 32271 | + let s2 = null | |
| 32272 | + const timeoutId = setTimeout(() => { | |
| 32273 | + // setImmediate is added to make sure that we priotorise socket error events over timeouts | |
| 32274 | + s1 = setImmediate(() => { | |
| 32275 | + if (process.platform === 'win32') { | |
| 32276 | + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic | |
| 32277 | + s2 = setImmediate(() => onConnectTimeout()) | |
| 32278 | + } else { | |
| 32279 | + onConnectTimeout() | |
| 32280 | + } | |
| 32281 | + }) | |
| 32282 | + }, timeout) | |
| 32283 | + return () => { | |
| 32284 | + clearTimeout(timeoutId) | |
| 32285 | + clearImmediate(s1) | |
| 32286 | + clearImmediate(s2) | |
| 32287 | + } | |
| 32288 | +} | |
| 32289 | + | |
| 32290 | +function onConnectTimeout (socket) { | |
| 32291 | + util.destroy(socket, new ConnectTimeoutError()) | |
| 32292 | +} | |
| 32293 | + | |
| 32294 | +module.exports = buildConnector | |
| 32295 | + | |
| 32296 | + | |
| 32297 | +/***/ }), | |
| 32298 | + | |
| 32299 | +/***/ 735: | |
| 32300 | +/***/ ((module) => { | |
| 32301 | + | |
| 32302 | +"use strict"; | |
| 32303 | + | |
| 32304 | + | |
| 32305 | +/** @type {Record<string, string | undefined>} */ | |
| 32306 | +const headerNameLowerCasedRecord = {} | |
| 32307 | + | |
| 32308 | +// https://developer.mozilla.org/docs/Web/HTTP/Headers | |
| 32309 | +const wellknownHeaderNames = [ | |
| 32310 | + 'Accept', | |
| 32311 | + 'Accept-Encoding', | |
| 32312 | + 'Accept-Language', | |
| 32313 | + 'Accept-Ranges', | |
| 32314 | + 'Access-Control-Allow-Credentials', | |
| 32315 | + 'Access-Control-Allow-Headers', | |
| 32316 | + 'Access-Control-Allow-Methods', | |
| 32317 | + 'Access-Control-Allow-Origin', | |
| 32318 | + 'Access-Control-Expose-Headers', | |
| 32319 | + 'Access-Control-Max-Age', | |
| 32320 | + 'Access-Control-Request-Headers', | |
| 32321 | + 'Access-Control-Request-Method', | |
| 32322 | + 'Age', | |
| 32323 | + 'Allow', | |
| 32324 | + 'Alt-Svc', | |
| 32325 | + 'Alt-Used', | |
| 32326 | + 'Authorization', | |
| 32327 | + 'Cache-Control', | |
| 32328 | + 'Clear-Site-Data', | |
| 32329 | + 'Connection', | |
| 32330 | + 'Content-Disposition', | |
| 32331 | + 'Content-Encoding', | |
| 32332 | + 'Content-Language', | |
| 32333 | + 'Content-Length', | |
| 32334 | + 'Content-Location', | |
| 32335 | + 'Content-Range', | |
| 32336 | + 'Content-Security-Policy', | |
| 32337 | + 'Content-Security-Policy-Report-Only', | |
| 32338 | + 'Content-Type', | |
| 32339 | + 'Cookie', | |
| 32340 | + 'Cross-Origin-Embedder-Policy', | |
| 32341 | + 'Cross-Origin-Opener-Policy', | |
| 32342 | + 'Cross-Origin-Resource-Policy', | |
| 32343 | + 'Date', | |
| 32344 | + 'Device-Memory', | |
| 32345 | + 'Downlink', | |
| 32346 | + 'ECT', | |
| 32347 | + 'ETag', | |
| 32348 | + 'Expect', | |
| 32349 | + 'Expect-CT', | |
| 32350 | + 'Expires', | |
| 32351 | + 'Forwarded', | |
| 32352 | + 'From', | |
| 32353 | + 'Host', | |
| 32354 | + 'If-Match', | |
| 32355 | + 'If-Modified-Since', | |
| 32356 | + 'If-None-Match', | |
| 32357 | + 'If-Range', | |
| 32358 | + 'If-Unmodified-Since', | |
| 32359 | + 'Keep-Alive', | |
| 32360 | + 'Last-Modified', | |
| 32361 | + 'Link', | |
| 32362 | + 'Location', | |
| 32363 | + 'Max-Forwards', | |
| 32364 | + 'Origin', | |
| 32365 | + 'Permissions-Policy', | |
| 32366 | + 'Pragma', | |
| 32367 | + 'Proxy-Authenticate', | |
| 32368 | + 'Proxy-Authorization', | |
| 32369 | + 'RTT', | |
| 32370 | + 'Range', | |
| 32371 | + 'Referer', | |
| 32372 | + 'Referrer-Policy', | |
| 32373 | + 'Refresh', | |
| 32374 | + 'Retry-After', | |
| 32375 | + 'Sec-WebSocket-Accept', | |
| 32376 | + 'Sec-WebSocket-Extensions', | |
| 32377 | + 'Sec-WebSocket-Key', | |
| 32378 | + 'Sec-WebSocket-Protocol', | |
| 32379 | + 'Sec-WebSocket-Version', | |
| 32380 | + 'Server', | |
| 32381 | + 'Server-Timing', | |
| 32382 | + 'Service-Worker-Allowed', | |
| 32383 | + 'Service-Worker-Navigation-Preload', | |
| 32384 | + 'Set-Cookie', | |
| 32385 | + 'SourceMap', | |
| 32386 | + 'Strict-Transport-Security', | |
| 32387 | + 'Supports-Loading-Mode', | |
| 32388 | + 'TE', | |
| 32389 | + 'Timing-Allow-Origin', | |
| 32390 | + 'Trailer', | |
| 32391 | + 'Transfer-Encoding', | |
| 32392 | + 'Upgrade', | |
| 32393 | + 'Upgrade-Insecure-Requests', | |
| 32394 | + 'User-Agent', | |
| 32395 | + 'Vary', | |
| 32396 | + 'Via', | |
| 32397 | + 'WWW-Authenticate', | |
| 32398 | + 'X-Content-Type-Options', | |
| 32399 | + 'X-DNS-Prefetch-Control', | |
| 32400 | + 'X-Frame-Options', | |
| 32401 | + 'X-Permitted-Cross-Domain-Policies', | |
| 32402 | + 'X-Powered-By', | |
| 32403 | + 'X-Requested-With', | |
| 32404 | + 'X-XSS-Protection' | |
| 32405 | +] | |
| 32406 | + | |
| 32407 | +for (let i = 0; i < wellknownHeaderNames.length; ++i) { | |
| 32408 | + const key = wellknownHeaderNames[i] | |
| 32409 | + const lowerCasedKey = key.toLowerCase() | |
| 32410 | + headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = | |
| 32411 | + lowerCasedKey | |
| 32412 | +} | |
| 32413 | + | |
| 32414 | +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. | |
| 32415 | +Object.setPrototypeOf(headerNameLowerCasedRecord, null) | |
| 32416 | + | |
| 32417 | +module.exports = { | |
| 32418 | + wellknownHeaderNames, | |
| 32419 | + headerNameLowerCasedRecord | |
| 32420 | +} | |
| 32421 | + | |
| 32422 | + | |
| 32423 | +/***/ }), | |
| 32424 | + | |
| 32425 | +/***/ 8707: | |
| 32426 | +/***/ ((module) => { | |
| 32427 | + | |
| 32428 | +"use strict"; | |
| 32429 | + | |
| 32430 | + | |
| 32431 | +class UndiciError extends Error { | |
| 32432 | + constructor (message) { | |
| 32433 | + super(message) | |
| 32434 | + this.name = 'UndiciError' | |
| 32435 | + this.code = 'UND_ERR' | |
| 32436 | + } | |
| 32437 | +} | |
| 32438 | + | |
| 32439 | +class ConnectTimeoutError extends UndiciError { | |
| 32440 | + constructor (message) { | |
| 32441 | + super(message) | |
| 32442 | + Error.captureStackTrace(this, ConnectTimeoutError) | |
| 32443 | + this.name = 'ConnectTimeoutError' | |
| 32444 | + this.message = message || 'Connect Timeout Error' | |
| 32445 | + this.code = 'UND_ERR_CONNECT_TIMEOUT' | |
| 32446 | + } | |
| 32447 | +} | |
| 32448 | + | |
| 32449 | +class HeadersTimeoutError extends UndiciError { | |
| 32450 | + constructor (message) { | |
| 32451 | + super(message) | |
| 32452 | + Error.captureStackTrace(this, HeadersTimeoutError) | |
| 32453 | + this.name = 'HeadersTimeoutError' | |
| 32454 | + this.message = message || 'Headers Timeout Error' | |
| 32455 | + this.code = 'UND_ERR_HEADERS_TIMEOUT' | |
| 32456 | + } | |
| 32457 | +} | |
| 32458 | + | |
| 32459 | +class HeadersOverflowError extends UndiciError { | |
| 32460 | + constructor (message) { | |
| 32461 | + super(message) | |
| 32462 | + Error.captureStackTrace(this, HeadersOverflowError) | |
| 32463 | + this.name = 'HeadersOverflowError' | |
| 32464 | + this.message = message || 'Headers Overflow Error' | |
| 32465 | + this.code = 'UND_ERR_HEADERS_OVERFLOW' | |
| 32466 | + } | |
| 32467 | +} | |
| 32468 | + | |
| 32469 | +class BodyTimeoutError extends UndiciError { | |
| 32470 | + constructor (message) { | |
| 32471 | + super(message) | |
| 32472 | + Error.captureStackTrace(this, BodyTimeoutError) | |
| 32473 | + this.name = 'BodyTimeoutError' | |
| 32474 | + this.message = message || 'Body Timeout Error' | |
| 32475 | + this.code = 'UND_ERR_BODY_TIMEOUT' | |
| 32476 | + } | |
| 32477 | +} | |
| 32478 | + | |
| 32479 | +class ResponseStatusCodeError extends UndiciError { | |
| 32480 | + constructor (message, statusCode, headers, body) { | |
| 32481 | + super(message) | |
| 32482 | + Error.captureStackTrace(this, ResponseStatusCodeError) | |
| 32483 | + this.name = 'ResponseStatusCodeError' | |
| 32484 | + this.message = message || 'Response Status Code Error' | |
| 32485 | + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' | |
| 32486 | + this.body = body | |
| 32487 | + this.status = statusCode | |
| 32488 | + this.statusCode = statusCode | |
| 32489 | + this.headers = headers | |
| 32490 | + } | |
| 32491 | +} | |
| 32492 | + | |
| 32493 | +class InvalidArgumentError extends UndiciError { | |
| 32494 | + constructor (message) { | |
| 32495 | + super(message) | |
| 32496 | + Error.captureStackTrace(this, InvalidArgumentError) | |
| 32497 | + this.name = 'InvalidArgumentError' | |
| 32498 | + this.message = message || 'Invalid Argument Error' | |
| 32499 | + this.code = 'UND_ERR_INVALID_ARG' | |
| 32500 | + } | |
| 32501 | +} | |
| 32502 | + | |
| 32503 | +class InvalidReturnValueError extends UndiciError { | |
| 32504 | + constructor (message) { | |
| 32505 | + super(message) | |
| 32506 | + Error.captureStackTrace(this, InvalidReturnValueError) | |
| 32507 | + this.name = 'InvalidReturnValueError' | |
| 32508 | + this.message = message || 'Invalid Return Value Error' | |
| 32509 | + this.code = 'UND_ERR_INVALID_RETURN_VALUE' | |
| 32510 | + } | |
| 32511 | +} | |
| 32512 | + | |
| 32513 | +class RequestAbortedError extends UndiciError { | |
| 32514 | + constructor (message) { | |
| 32515 | + super(message) | |
| 32516 | + Error.captureStackTrace(this, RequestAbortedError) | |
| 32517 | + this.name = 'AbortError' | |
| 32518 | + this.message = message || 'Request aborted' | |
| 32519 | + this.code = 'UND_ERR_ABORTED' | |
| 32520 | + } | |
| 32521 | +} | |
| 32522 | + | |
| 32523 | +class InformationalError extends UndiciError { | |
| 32524 | + constructor (message) { | |
| 32525 | + super(message) | |
| 32526 | + Error.captureStackTrace(this, InformationalError) | |
| 32527 | + this.name = 'InformationalError' | |
| 32528 | + this.message = message || 'Request information' | |
| 32529 | + this.code = 'UND_ERR_INFO' | |
| 32530 | + } | |
| 32531 | +} | |
| 32532 | + | |
| 32533 | +class RequestContentLengthMismatchError extends UndiciError { | |
| 32534 | + constructor (message) { | |
| 32535 | + super(message) | |
| 32536 | + Error.captureStackTrace(this, RequestContentLengthMismatchError) | |
| 32537 | + this.name = 'RequestContentLengthMismatchError' | |
| 32538 | + this.message = message || 'Request body length does not match content-length header' | |
| 32539 | + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' | |
| 32540 | + } | |
| 32541 | +} | |
| 32542 | + | |
| 32543 | +class ResponseContentLengthMismatchError extends UndiciError { | |
| 32544 | + constructor (message) { | |
| 32545 | + super(message) | |
| 32546 | + Error.captureStackTrace(this, ResponseContentLengthMismatchError) | |
| 32547 | + this.name = 'ResponseContentLengthMismatchError' | |
| 32548 | + this.message = message || 'Response body length does not match content-length header' | |
| 32549 | + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' | |
| 32550 | + } | |
| 32551 | +} | |
| 32552 | + | |
| 32553 | +class ClientDestroyedError extends UndiciError { | |
| 32554 | + constructor (message) { | |
| 32555 | + super(message) | |
| 32556 | + Error.captureStackTrace(this, ClientDestroyedError) | |
| 32557 | + this.name = 'ClientDestroyedError' | |
| 32558 | + this.message = message || 'The client is destroyed' | |
| 32559 | + this.code = 'UND_ERR_DESTROYED' | |
| 32560 | + } | |
| 32561 | +} | |
| 32562 | + | |
| 32563 | +class ClientClosedError extends UndiciError { | |
| 32564 | + constructor (message) { | |
| 32565 | + super(message) | |
| 32566 | + Error.captureStackTrace(this, ClientClosedError) | |
| 32567 | + this.name = 'ClientClosedError' | |
| 32568 | + this.message = message || 'The client is closed' | |
| 32569 | + this.code = 'UND_ERR_CLOSED' | |
| 32570 | + } | |
| 32571 | +} | |
| 32572 | + | |
| 32573 | +class SocketError extends UndiciError { | |
| 32574 | + constructor (message, socket) { | |
| 32575 | + super(message) | |
| 32576 | + Error.captureStackTrace(this, SocketError) | |
| 32577 | + this.name = 'SocketError' | |
| 32578 | + this.message = message || 'Socket error' | |
| 32579 | + this.code = 'UND_ERR_SOCKET' | |
| 32580 | + this.socket = socket | |
| 32581 | + } | |
| 32582 | +} | |
| 32583 | + | |
| 32584 | +class NotSupportedError extends UndiciError { | |
| 32585 | + constructor (message) { | |
| 32586 | + super(message) | |
| 32587 | + Error.captureStackTrace(this, NotSupportedError) | |
| 32588 | + this.name = 'NotSupportedError' | |
| 32589 | + this.message = message || 'Not supported error' | |
| 32590 | + this.code = 'UND_ERR_NOT_SUPPORTED' | |
| 32591 | + } | |
| 32592 | +} | |
| 32593 | + | |
| 32594 | +class BalancedPoolMissingUpstreamError extends UndiciError { | |
| 32595 | + constructor (message) { | |
| 32596 | + super(message) | |
| 32597 | + Error.captureStackTrace(this, NotSupportedError) | |
| 32598 | + this.name = 'MissingUpstreamError' | |
| 32599 | + this.message = message || 'No upstream has been added to the BalancedPool' | |
| 32600 | + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' | |
| 32601 | + } | |
| 32602 | +} | |
| 32603 | + | |
| 32604 | +class HTTPParserError extends Error { | |
| 32605 | + constructor (message, code, data) { | |
| 32606 | + super(message) | |
| 32607 | + Error.captureStackTrace(this, HTTPParserError) | |
| 32608 | + this.name = 'HTTPParserError' | |
| 32609 | + this.code = code ? `HPE_${code}` : undefined | |
| 32610 | + this.data = data ? data.toString() : undefined | |
| 32611 | + } | |
| 32612 | +} | |
| 32613 | + | |
| 32614 | +class ResponseExceededMaxSizeError extends UndiciError { | |
| 32615 | + constructor (message) { | |
| 32616 | + super(message) | |
| 32617 | + Error.captureStackTrace(this, ResponseExceededMaxSizeError) | |
| 32618 | + this.name = 'ResponseExceededMaxSizeError' | |
| 32619 | + this.message = message || 'Response content exceeded max size' | |
| 32620 | + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' | |
| 32621 | + } | |
| 32622 | +} | |
| 32623 | + | |
| 32624 | +class RequestRetryError extends UndiciError { | |
| 32625 | + constructor (message, code, { headers, data }) { | |
| 32626 | + super(message) | |
| 32627 | + Error.captureStackTrace(this, RequestRetryError) | |
| 32628 | + this.name = 'RequestRetryError' | |
| 32629 | + this.message = message || 'Request retry error' | |
| 32630 | + this.code = 'UND_ERR_REQ_RETRY' | |
| 32631 | + this.statusCode = code | |
| 32632 | + this.data = data | |
| 32633 | + this.headers = headers | |
| 32634 | + } | |
| 32635 | +} | |
| 32636 | + | |
| 32637 | +module.exports = { | |
| 32638 | + HTTPParserError, | |
| 32639 | + UndiciError, | |
| 32640 | + HeadersTimeoutError, | |
| 32641 | + HeadersOverflowError, | |
| 32642 | + BodyTimeoutError, | |
| 32643 | + RequestContentLengthMismatchError, | |
| 32644 | + ConnectTimeoutError, | |
| 32645 | + ResponseStatusCodeError, | |
| 32646 | + InvalidArgumentError, | |
| 32647 | + InvalidReturnValueError, | |
| 32648 | + RequestAbortedError, | |
| 32649 | + ClientDestroyedError, | |
| 32650 | + ClientClosedError, | |
| 32651 | + InformationalError, | |
| 32652 | + SocketError, | |
| 32653 | + NotSupportedError, | |
| 32654 | + ResponseContentLengthMismatchError, | |
| 32655 | + BalancedPoolMissingUpstreamError, | |
| 32656 | + ResponseExceededMaxSizeError, | |
| 32657 | + RequestRetryError | |
| 32658 | +} | |
| 32659 | + | |
| 32660 | + | |
| 32661 | +/***/ }), | |
| 32662 | + | |
| 32663 | +/***/ 4655: | |
| 32664 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 32665 | + | |
| 32666 | +"use strict"; | |
| 32667 | + | |
| 32668 | + | |
| 32669 | +const { | |
| 32670 | + InvalidArgumentError, | |
| 32671 | + NotSupportedError | |
| 32672 | +} = __nccwpck_require__(8707) | |
| 32673 | +const assert = __nccwpck_require__(2613) | |
| 32674 | +const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(6443) | |
| 32675 | +const util = __nccwpck_require__(3440) | |
| 32676 | + | |
| 32677 | +// tokenRegExp and headerCharRegex have been lifted from | |
| 32678 | +// https://github.com/nodejs/node/blob/main/lib/_http_common.js | |
| 32679 | + | |
| 32680 | +/** | |
| 32681 | + * Verifies that the given val is a valid HTTP token | |
| 32682 | + * per the rules defined in RFC 7230 | |
| 32683 | + * See https://tools.ietf.org/html/rfc7230#section-3.2.6 | |
| 32684 | + */ | |
| 32685 | +const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ | |
| 32686 | + | |
| 32687 | +/** | |
| 32688 | + * Matches if val contains an invalid field-vchar | |
| 32689 | + * field-value = *( field-content / obs-fold ) | |
| 32690 | + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] | |
| 32691 | + * field-vchar = VCHAR / obs-text | |
| 32692 | + */ | |
| 32693 | +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ | |
| 32694 | + | |
| 32695 | +// Verifies that a given path is valid does not contain control chars \x00 to \x20 | |
| 32696 | +const invalidPathRegex = /[^\u0021-\u00ff]/ | |
| 32697 | + | |
| 32698 | +const kHandler = Symbol('handler') | |
| 32699 | + | |
| 32700 | +const channels = {} | |
| 32701 | + | |
| 32702 | +let extractBody | |
| 32703 | + | |
| 32704 | +try { | |
| 32705 | + const diagnosticsChannel = __nccwpck_require__(1637) | |
| 32706 | + channels.create = diagnosticsChannel.channel('undici:request:create') | |
| 32707 | + channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') | |
| 32708 | + channels.headers = diagnosticsChannel.channel('undici:request:headers') | |
| 32709 | + channels.trailers = diagnosticsChannel.channel('undici:request:trailers') | |
| 32710 | + channels.error = diagnosticsChannel.channel('undici:request:error') | |
| 32711 | +} catch { | |
| 32712 | + channels.create = { hasSubscribers: false } | |
| 32713 | + channels.bodySent = { hasSubscribers: false } | |
| 32714 | + channels.headers = { hasSubscribers: false } | |
| 32715 | + channels.trailers = { hasSubscribers: false } | |
| 32716 | + channels.error = { hasSubscribers: false } | |
| 32717 | +} | |
| 32718 | + | |
| 32719 | +class Request { | |
| 32720 | + constructor (origin, { | |
| 32721 | + path, | |
| 32722 | + method, | |
| 32723 | + body, | |
| 32724 | + headers, | |
| 32725 | + query, | |
| 32726 | + idempotent, | |
| 32727 | + blocking, | |
| 32728 | + upgrade, | |
| 32729 | + headersTimeout, | |
| 32730 | + bodyTimeout, | |
| 32731 | + reset, | |
| 32732 | + throwOnError, | |
| 32733 | + expectContinue | |
| 32734 | + }, handler) { | |
| 32735 | + if (typeof path !== 'string') { | |
| 32736 | + throw new InvalidArgumentError('path must be a string') | |
| 32737 | + } else if ( | |
| 32738 | + path[0] !== '/' && | |
| 32739 | + !(path.startsWith('http://') || path.startsWith('https://')) && | |
| 32740 | + method !== 'CONNECT' | |
| 32741 | + ) { | |
| 32742 | + throw new InvalidArgumentError('path must be an absolute URL or start with a slash') | |
| 32743 | + } else if (invalidPathRegex.exec(path) !== null) { | |
| 32744 | + throw new InvalidArgumentError('invalid request path') | |
| 32745 | + } | |
| 32746 | + | |
| 32747 | + if (typeof method !== 'string') { | |
| 32748 | + throw new InvalidArgumentError('method must be a string') | |
| 32749 | + } else if (tokenRegExp.exec(method) === null) { | |
| 32750 | + throw new InvalidArgumentError('invalid request method') | |
| 32751 | + } | |
| 32752 | + | |
| 32753 | + if (upgrade && typeof upgrade !== 'string') { | |
| 32754 | + throw new InvalidArgumentError('upgrade must be a string') | |
| 32755 | + } | |
| 32756 | + | |
| 32757 | + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { | |
| 32758 | + throw new InvalidArgumentError('invalid headersTimeout') | |
| 32759 | + } | |
| 32760 | + | |
| 32761 | + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { | |
| 32762 | + throw new InvalidArgumentError('invalid bodyTimeout') | |
| 32763 | + } | |
| 32764 | + | |
| 32765 | + if (reset != null && typeof reset !== 'boolean') { | |
| 32766 | + throw new InvalidArgumentError('invalid reset') | |
| 32767 | + } | |
| 32768 | + | |
| 32769 | + if (expectContinue != null && typeof expectContinue !== 'boolean') { | |
| 32770 | + throw new InvalidArgumentError('invalid expectContinue') | |
| 32771 | + } | |
| 32772 | + | |
| 32773 | + this.headersTimeout = headersTimeout | |
| 32774 | + | |
| 32775 | + this.bodyTimeout = bodyTimeout | |
| 32776 | + | |
| 32777 | + this.throwOnError = throwOnError === true | |
| 32778 | + | |
| 32779 | + this.method = method | |
| 32780 | + | |
| 32781 | + this.abort = null | |
| 32782 | + | |
| 32783 | + if (body == null) { | |
| 32784 | + this.body = null | |
| 32785 | + } else if (util.isStream(body)) { | |
| 32786 | + this.body = body | |
| 32787 | + | |
| 32788 | + const rState = this.body._readableState | |
| 32789 | + if (!rState || !rState.autoDestroy) { | |
| 32790 | + this.endHandler = function autoDestroy () { | |
| 32791 | + util.destroy(this) | |
| 32792 | + } | |
| 32793 | + this.body.on('end', this.endHandler) | |
| 32794 | + } | |
| 32795 | + | |
| 32796 | + this.errorHandler = err => { | |
| 32797 | + if (this.abort) { | |
| 32798 | + this.abort(err) | |
| 32799 | + } else { | |
| 32800 | + this.error = err | |
| 32801 | + } | |
| 32802 | + } | |
| 32803 | + this.body.on('error', this.errorHandler) | |
| 32804 | + } else if (util.isBuffer(body)) { | |
| 32805 | + this.body = body.byteLength ? body : null | |
| 32806 | + } else if (ArrayBuffer.isView(body)) { | |
| 32807 | + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null | |
| 32808 | + } else if (body instanceof ArrayBuffer) { | |
| 32809 | + this.body = body.byteLength ? Buffer.from(body) : null | |
| 32810 | + } else if (typeof body === 'string') { | |
| 32811 | + this.body = body.length ? Buffer.from(body) : null | |
| 32812 | + } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { | |
| 32813 | + this.body = body | |
| 32814 | + } else { | |
| 32815 | + throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') | |
| 32816 | + } | |
| 32817 | + | |
| 32818 | + this.completed = false | |
| 32819 | + | |
| 32820 | + this.aborted = false | |
| 32821 | + | |
| 32822 | + this.upgrade = upgrade || null | |
| 32823 | + | |
| 32824 | + this.path = query ? util.buildURL(path, query) : path | |
| 32825 | + | |
| 32826 | + this.origin = origin | |
| 32827 | + | |
| 32828 | + this.idempotent = idempotent == null | |
| 32829 | + ? method === 'HEAD' || method === 'GET' | |
| 32830 | + : idempotent | |
| 32831 | + | |
| 32832 | + this.blocking = blocking == null ? false : blocking | |
| 32833 | + | |
| 32834 | + this.reset = reset == null ? null : reset | |
| 32835 | + | |
| 32836 | + this.host = null | |
| 32837 | + | |
| 32838 | + this.contentLength = null | |
| 32839 | + | |
| 32840 | + this.contentType = null | |
| 32841 | + | |
| 32842 | + this.headers = '' | |
| 32843 | + | |
| 32844 | + // Only for H2 | |
| 32845 | + this.expectContinue = expectContinue != null ? expectContinue : false | |
| 32846 | + | |
| 32847 | + if (Array.isArray(headers)) { | |
| 32848 | + if (headers.length % 2 !== 0) { | |
| 32849 | + throw new InvalidArgumentError('headers array must be even') | |
| 32850 | + } | |
| 32851 | + for (let i = 0; i < headers.length; i += 2) { | |
| 32852 | + processHeader(this, headers[i], headers[i + 1]) | |
| 32853 | + } | |
| 32854 | + } else if (headers && typeof headers === 'object') { | |
| 32855 | + const keys = Object.keys(headers) | |
| 32856 | + for (let i = 0; i < keys.length; i++) { | |
| 32857 | + const key = keys[i] | |
| 32858 | + processHeader(this, key, headers[key]) | |
| 32859 | + } | |
| 32860 | + } else if (headers != null) { | |
| 32861 | + throw new InvalidArgumentError('headers must be an object or an array') | |
| 32862 | + } | |
| 32863 | + | |
| 32864 | + if (util.isFormDataLike(this.body)) { | |
| 32865 | + if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { | |
| 32866 | + throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') | |
| 32867 | + } | |
| 32868 | + | |
| 32869 | + if (!extractBody) { | |
| 32870 | + extractBody = (__nccwpck_require__(8923).extractBody) | |
| 32871 | + } | |
| 32872 | + | |
| 32873 | + const [bodyStream, contentType] = extractBody(body) | |
| 32874 | + if (this.contentType == null) { | |
| 32875 | + this.contentType = contentType | |
| 32876 | + this.headers += `content-type: ${contentType}\r\n` | |
| 32877 | + } | |
| 32878 | + this.body = bodyStream.stream | |
| 32879 | + this.contentLength = bodyStream.length | |
| 32880 | + } else if (util.isBlobLike(body) && this.contentType == null && body.type) { | |
| 32881 | + this.contentType = body.type | |
| 32882 | + this.headers += `content-type: ${body.type}\r\n` | |
| 32883 | + } | |
| 32884 | + | |
| 32885 | + util.validateHandler(handler, method, upgrade) | |
| 32886 | + | |
| 32887 | + this.servername = util.getServerName(this.host) | |
| 32888 | + | |
| 32889 | + this[kHandler] = handler | |
| 32890 | + | |
| 32891 | + if (channels.create.hasSubscribers) { | |
| 32892 | + channels.create.publish({ request: this }) | |
| 32893 | + } | |
| 32894 | + } | |
| 32895 | + | |
| 32896 | + onBodySent (chunk) { | |
| 32897 | + if (this[kHandler].onBodySent) { | |
| 32898 | + try { | |
| 32899 | + return this[kHandler].onBodySent(chunk) | |
| 32900 | + } catch (err) { | |
| 32901 | + this.abort(err) | |
| 32902 | + } | |
| 32903 | + } | |
| 32904 | + } | |
| 32905 | + | |
| 32906 | + onRequestSent () { | |
| 32907 | + if (channels.bodySent.hasSubscribers) { | |
| 32908 | + channels.bodySent.publish({ request: this }) | |
| 32909 | + } | |
| 32910 | + | |
| 32911 | + if (this[kHandler].onRequestSent) { | |
| 32912 | + try { | |
| 32913 | + return this[kHandler].onRequestSent() | |
| 32914 | + } catch (err) { | |
| 32915 | + this.abort(err) | |
| 32916 | + } | |
| 32917 | + } | |
| 32918 | + } | |
| 32919 | + | |
| 32920 | + onConnect (abort) { | |
| 32921 | + assert(!this.aborted) | |
| 32922 | + assert(!this.completed) | |
| 32923 | + | |
| 32924 | + if (this.error) { | |
| 32925 | + abort(this.error) | |
| 32926 | + } else { | |
| 32927 | + this.abort = abort | |
| 32928 | + return this[kHandler].onConnect(abort) | |
| 32929 | + } | |
| 32930 | + } | |
| 32931 | + | |
| 32932 | + onHeaders (statusCode, headers, resume, statusText) { | |
| 32933 | + assert(!this.aborted) | |
| 32934 | + assert(!this.completed) | |
| 32935 | + | |
| 32936 | + if (channels.headers.hasSubscribers) { | |
| 32937 | + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) | |
| 32938 | + } | |
| 32939 | + | |
| 32940 | + try { | |
| 32941 | + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) | |
| 32942 | + } catch (err) { | |
| 32943 | + this.abort(err) | |
| 32944 | + } | |
| 32945 | + } | |
| 32946 | + | |
| 32947 | + onData (chunk) { | |
| 32948 | + assert(!this.aborted) | |
| 32949 | + assert(!this.completed) | |
| 32950 | + | |
| 32951 | + try { | |
| 32952 | + return this[kHandler].onData(chunk) | |
| 32953 | + } catch (err) { | |
| 32954 | + this.abort(err) | |
| 32955 | + return false | |
| 32956 | + } | |
| 32957 | + } | |
| 32958 | + | |
| 32959 | + onUpgrade (statusCode, headers, socket) { | |
| 32960 | + assert(!this.aborted) | |
| 32961 | + assert(!this.completed) | |
| 32962 | + | |
| 32963 | + return this[kHandler].onUpgrade(statusCode, headers, socket) | |
| 32964 | + } | |
| 32965 | + | |
| 32966 | + onComplete (trailers) { | |
| 32967 | + this.onFinally() | |
| 32968 | + | |
| 32969 | + assert(!this.aborted) | |
| 32970 | + | |
| 32971 | + this.completed = true | |
| 32972 | + if (channels.trailers.hasSubscribers) { | |
| 32973 | + channels.trailers.publish({ request: this, trailers }) | |
| 32974 | + } | |
| 32975 | + | |
| 32976 | + try { | |
| 32977 | + return this[kHandler].onComplete(trailers) | |
| 32978 | + } catch (err) { | |
| 32979 | + // TODO (fix): This might be a bad idea? | |
| 32980 | + this.onError(err) | |
| 32981 | + } | |
| 32982 | + } | |
| 32983 | + | |
| 32984 | + onError (error) { | |
| 32985 | + this.onFinally() | |
| 32986 | + | |
| 32987 | + if (channels.error.hasSubscribers) { | |
| 32988 | + channels.error.publish({ request: this, error }) | |
| 32989 | + } | |
| 32990 | + | |
| 32991 | + if (this.aborted) { | |
| 32992 | + return | |
| 32993 | + } | |
| 32994 | + this.aborted = true | |
| 32995 | + | |
| 32996 | + return this[kHandler].onError(error) | |
| 32997 | + } | |
| 32998 | + | |
| 32999 | + onFinally () { | |
| 33000 | + if (this.errorHandler) { | |
| 33001 | + this.body.off('error', this.errorHandler) | |
| 33002 | + this.errorHandler = null | |
| 33003 | + } | |
| 33004 | + | |
| 33005 | + if (this.endHandler) { | |
| 33006 | + this.body.off('end', this.endHandler) | |
| 33007 | + this.endHandler = null | |
| 33008 | + } | |
| 33009 | + } | |
| 33010 | + | |
| 33011 | + // TODO: adjust to support H2 | |
| 33012 | + addHeader (key, value) { | |
| 33013 | + processHeader(this, key, value) | |
| 33014 | + return this | |
| 33015 | + } | |
| 33016 | + | |
| 33017 | + static [kHTTP1BuildRequest] (origin, opts, handler) { | |
| 33018 | + // TODO: Migrate header parsing here, to make Requests | |
| 33019 | + // HTTP agnostic | |
| 33020 | + return new Request(origin, opts, handler) | |
| 33021 | + } | |
| 33022 | + | |
| 33023 | + static [kHTTP2BuildRequest] (origin, opts, handler) { | |
| 33024 | + const headers = opts.headers | |
| 33025 | + opts = { ...opts, headers: null } | |
| 33026 | + | |
| 33027 | + const request = new Request(origin, opts, handler) | |
| 33028 | + | |
| 33029 | + request.headers = {} | |
| 33030 | + | |
| 33031 | + if (Array.isArray(headers)) { | |
| 33032 | + if (headers.length % 2 !== 0) { | |
| 33033 | + throw new InvalidArgumentError('headers array must be even') | |
| 33034 | + } | |
| 33035 | + for (let i = 0; i < headers.length; i += 2) { | |
| 33036 | + processHeader(request, headers[i], headers[i + 1], true) | |
| 33037 | + } | |
| 33038 | + } else if (headers && typeof headers === 'object') { | |
| 33039 | + const keys = Object.keys(headers) | |
| 33040 | + for (let i = 0; i < keys.length; i++) { | |
| 33041 | + const key = keys[i] | |
| 33042 | + processHeader(request, key, headers[key], true) | |
| 33043 | + } | |
| 33044 | + } else if (headers != null) { | |
| 33045 | + throw new InvalidArgumentError('headers must be an object or an array') | |
| 33046 | + } | |
| 33047 | + | |
| 33048 | + return request | |
| 33049 | + } | |
| 33050 | + | |
| 33051 | + static [kHTTP2CopyHeaders] (raw) { | |
| 33052 | + const rawHeaders = raw.split('\r\n') | |
| 33053 | + const headers = {} | |
| 33054 | + | |
| 33055 | + for (const header of rawHeaders) { | |
| 33056 | + const [key, value] = header.split(': ') | |
| 33057 | + | |
| 33058 | + if (value == null || value.length === 0) continue | |
| 33059 | + | |
| 33060 | + if (headers[key]) headers[key] += `,${value}` | |
| 33061 | + else headers[key] = value | |
| 33062 | + } | |
| 33063 | + | |
| 33064 | + return headers | |
| 33065 | + } | |
| 33066 | +} | |
| 33067 | + | |
| 33068 | +function processHeaderValue (key, val, skipAppend) { | |
| 33069 | + if (val && typeof val === 'object') { | |
| 33070 | + throw new InvalidArgumentError(`invalid ${key} header`) | |
| 33071 | + } | |
| 33072 | + | |
| 33073 | + val = val != null ? `${val}` : '' | |
| 33074 | + | |
| 33075 | + if (headerCharRegex.exec(val) !== null) { | |
| 33076 | + throw new InvalidArgumentError(`invalid ${key} header`) | |
| 33077 | + } | |
| 33078 | + | |
| 33079 | + return skipAppend ? val : `${key}: ${val}\r\n` | |
| 33080 | +} | |
| 33081 | + | |
| 33082 | +function processHeader (request, key, val, skipAppend = false) { | |
| 33083 | + if (val && (typeof val === 'object' && !Array.isArray(val))) { | |
| 33084 | + throw new InvalidArgumentError(`invalid ${key} header`) | |
| 33085 | + } else if (val === undefined) { | |
| 33086 | + return | |
| 33087 | + } | |
| 33088 | + | |
| 33089 | + if ( | |
| 33090 | + request.host === null && | |
| 33091 | + key.length === 4 && | |
| 33092 | + key.toLowerCase() === 'host' | |
| 33093 | + ) { | |
| 33094 | + if (headerCharRegex.exec(val) !== null) { | |
| 33095 | + throw new InvalidArgumentError(`invalid ${key} header`) | |
| 33096 | + } | |
| 33097 | + // Consumed by Client | |
| 33098 | + request.host = val | |
| 33099 | + } else if ( | |
| 33100 | + request.contentLength === null && | |
| 33101 | + key.length === 14 && | |
| 33102 | + key.toLowerCase() === 'content-length' | |
| 33103 | + ) { | |
| 33104 | + request.contentLength = parseInt(val, 10) | |
| 33105 | + if (!Number.isFinite(request.contentLength)) { | |
| 33106 | + throw new InvalidArgumentError('invalid content-length header') | |
| 33107 | + } | |
| 33108 | + } else if ( | |
| 33109 | + request.contentType === null && | |
| 33110 | + key.length === 12 && | |
| 33111 | + key.toLowerCase() === 'content-type' | |
| 33112 | + ) { | |
| 33113 | + request.contentType = val | |
| 33114 | + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) | |
| 33115 | + else request.headers += processHeaderValue(key, val) | |
| 33116 | + } else if ( | |
| 33117 | + key.length === 17 && | |
| 33118 | + key.toLowerCase() === 'transfer-encoding' | |
| 33119 | + ) { | |
| 33120 | + throw new InvalidArgumentError('invalid transfer-encoding header') | |
| 33121 | + } else if ( | |
| 33122 | + key.length === 10 && | |
| 33123 | + key.toLowerCase() === 'connection' | |
| 33124 | + ) { | |
| 33125 | + const value = typeof val === 'string' ? val.toLowerCase() : null | |
| 33126 | + if (value !== 'close' && value !== 'keep-alive') { | |
| 33127 | + throw new InvalidArgumentError('invalid connection header') | |
| 33128 | + } else if (value === 'close') { | |
| 33129 | + request.reset = true | |
| 33130 | + } | |
| 33131 | + } else if ( | |
| 33132 | + key.length === 10 && | |
| 33133 | + key.toLowerCase() === 'keep-alive' | |
| 33134 | + ) { | |
| 33135 | + throw new InvalidArgumentError('invalid keep-alive header') | |
| 33136 | + } else if ( | |
| 33137 | + key.length === 7 && | |
| 33138 | + key.toLowerCase() === 'upgrade' | |
| 33139 | + ) { | |
| 33140 | + throw new InvalidArgumentError('invalid upgrade header') | |
| 33141 | + } else if ( | |
| 33142 | + key.length === 6 && | |
| 33143 | + key.toLowerCase() === 'expect' | |
| 33144 | + ) { | |
| 33145 | + throw new NotSupportedError('expect header not supported') | |
| 33146 | + } else if (tokenRegExp.exec(key) === null) { | |
| 33147 | + throw new InvalidArgumentError('invalid header key') | |
| 33148 | + } else { | |
| 33149 | + if (Array.isArray(val)) { | |
| 33150 | + for (let i = 0; i < val.length; i++) { | |
| 33151 | + if (skipAppend) { | |
| 33152 | + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` | |
| 33153 | + else request.headers[key] = processHeaderValue(key, val[i], skipAppend) | |
| 33154 | + } else { | |
| 33155 | + request.headers += processHeaderValue(key, val[i]) | |
| 33156 | + } | |
| 33157 | + } | |
| 33158 | + } else { | |
| 33159 | + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) | |
| 33160 | + else request.headers += processHeaderValue(key, val) | |
| 33161 | + } | |
| 33162 | + } | |
| 33163 | +} | |
| 33164 | + | |
| 33165 | +module.exports = Request | |
| 33166 | + | |
| 33167 | + | |
| 33168 | +/***/ }), | |
| 33169 | + | |
| 33170 | +/***/ 6443: | |
| 33171 | +/***/ ((module) => { | |
| 33172 | + | |
| 33173 | +module.exports = { | |
| 33174 | + kClose: Symbol('close'), | |
| 33175 | + kDestroy: Symbol('destroy'), | |
| 33176 | + kDispatch: Symbol('dispatch'), | |
| 33177 | + kUrl: Symbol('url'), | |
| 33178 | + kWriting: Symbol('writing'), | |
| 33179 | + kResuming: Symbol('resuming'), | |
| 33180 | + kQueue: Symbol('queue'), | |
| 33181 | + kConnect: Symbol('connect'), | |
| 33182 | + kConnecting: Symbol('connecting'), | |
| 33183 | + kHeadersList: Symbol('headers list'), | |
| 33184 | + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), | |
| 33185 | + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), | |
| 33186 | + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), | |
| 33187 | + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), | |
| 33188 | + kKeepAlive: Symbol('keep alive'), | |
| 33189 | + kHeadersTimeout: Symbol('headers timeout'), | |
| 33190 | + kBodyTimeout: Symbol('body timeout'), | |
| 33191 | + kServerName: Symbol('server name'), | |
| 33192 | + kLocalAddress: Symbol('local address'), | |
| 33193 | + kHost: Symbol('host'), | |
| 33194 | + kNoRef: Symbol('no ref'), | |
| 33195 | + kBodyUsed: Symbol('used'), | |
| 33196 | + kRunning: Symbol('running'), | |
| 33197 | + kBlocking: Symbol('blocking'), | |
| 33198 | + kPending: Symbol('pending'), | |
| 33199 | + kSize: Symbol('size'), | |
| 33200 | + kBusy: Symbol('busy'), | |
| 33201 | + kQueued: Symbol('queued'), | |
| 33202 | + kFree: Symbol('free'), | |
| 33203 | + kConnected: Symbol('connected'), | |
| 33204 | + kClosed: Symbol('closed'), | |
| 33205 | + kNeedDrain: Symbol('need drain'), | |
| 33206 | + kReset: Symbol('reset'), | |
| 33207 | + kDestroyed: Symbol.for('nodejs.stream.destroyed'), | |
| 33208 | + kMaxHeadersSize: Symbol('max headers size'), | |
| 33209 | + kRunningIdx: Symbol('running index'), | |
| 33210 | + kPendingIdx: Symbol('pending index'), | |
| 33211 | + kError: Symbol('error'), | |
| 33212 | + kClients: Symbol('clients'), | |
| 33213 | + kClient: Symbol('client'), | |
| 33214 | + kParser: Symbol('parser'), | |
| 33215 | + kOnDestroyed: Symbol('destroy callbacks'), | |
| 33216 | + kPipelining: Symbol('pipelining'), | |
| 33217 | + kSocket: Symbol('socket'), | |
| 33218 | + kHostHeader: Symbol('host header'), | |
| 33219 | + kConnector: Symbol('connector'), | |
| 33220 | + kStrictContentLength: Symbol('strict content length'), | |
| 33221 | + kMaxRedirections: Symbol('maxRedirections'), | |
| 33222 | + kMaxRequests: Symbol('maxRequestsPerClient'), | |
| 33223 | + kProxy: Symbol('proxy agent options'), | |
| 33224 | + kCounter: Symbol('socket request counter'), | |
| 33225 | + kInterceptors: Symbol('dispatch interceptors'), | |
| 33226 | + kMaxResponseSize: Symbol('max response size'), | |
| 33227 | + kHTTP2Session: Symbol('http2Session'), | |
| 33228 | + kHTTP2SessionState: Symbol('http2Session state'), | |
| 33229 | + kHTTP2BuildRequest: Symbol('http2 build request'), | |
| 33230 | + kHTTP1BuildRequest: Symbol('http1 build request'), | |
| 33231 | + kHTTP2CopyHeaders: Symbol('http2 copy headers'), | |
| 33232 | + kHTTPConnVersion: Symbol('http connection version'), | |
| 33233 | + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), | |
| 33234 | + kConstruct: Symbol('constructable') | |
| 33235 | +} | |
| 33236 | + | |
| 33237 | + | |
| 33238 | +/***/ }), | |
| 33239 | + | |
| 33240 | +/***/ 3440: | |
| 33241 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 33242 | + | |
| 33243 | +"use strict"; | |
| 33244 | + | |
| 33245 | + | |
| 33246 | +const assert = __nccwpck_require__(2613) | |
| 33247 | +const { kDestroyed, kBodyUsed } = __nccwpck_require__(6443) | |
| 33248 | +const { IncomingMessage } = __nccwpck_require__(8611) | |
| 33249 | +const stream = __nccwpck_require__(2203) | |
| 33250 | +const net = __nccwpck_require__(9278) | |
| 33251 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 33252 | +const { Blob } = __nccwpck_require__(181) | |
| 33253 | +const nodeUtil = __nccwpck_require__(9023) | |
| 33254 | +const { stringify } = __nccwpck_require__(3480) | |
| 33255 | +const { headerNameLowerCasedRecord } = __nccwpck_require__(735) | |
| 33256 | + | |
| 33257 | +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) | |
| 33258 | + | |
| 33259 | +function nop () {} | |
| 33260 | + | |
| 33261 | +function isStream (obj) { | |
| 33262 | + return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' | |
| 33263 | +} | |
| 33264 | + | |
| 33265 | +// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) | |
| 33266 | +function isBlobLike (object) { | |
| 33267 | + return (Blob && object instanceof Blob) || ( | |
| 33268 | + object && | |
| 33269 | + typeof object === 'object' && | |
| 33270 | + (typeof object.stream === 'function' || | |
| 33271 | + typeof object.arrayBuffer === 'function') && | |
| 33272 | + /^(Blob|File)$/.test(object[Symbol.toStringTag]) | |
| 33273 | + ) | |
| 33274 | +} | |
| 33275 | + | |
| 33276 | +function buildURL (url, queryParams) { | |
| 33277 | + if (url.includes('?') || url.includes('#')) { | |
| 33278 | + throw new Error('Query params cannot be passed when url already contains "?" or "#".') | |
| 33279 | + } | |
| 33280 | + | |
| 33281 | + const stringified = stringify(queryParams) | |
| 33282 | + | |
| 33283 | + if (stringified) { | |
| 33284 | + url += '?' + stringified | |
| 33285 | + } | |
| 33286 | + | |
| 33287 | + return url | |
| 33288 | +} | |
| 33289 | + | |
| 33290 | +function parseURL (url) { | |
| 33291 | + if (typeof url === 'string') { | |
| 33292 | + url = new URL(url) | |
| 33293 | + | |
| 33294 | + if (!/^https?:/.test(url.origin || url.protocol)) { | |
| 33295 | + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') | |
| 33296 | + } | |
| 33297 | + | |
| 33298 | + return url | |
| 33299 | + } | |
| 33300 | + | |
| 33301 | + if (!url || typeof url !== 'object') { | |
| 33302 | + throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') | |
| 33303 | + } | |
| 33304 | + | |
| 33305 | + if (!/^https?:/.test(url.origin || url.protocol)) { | |
| 33306 | + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') | |
| 33307 | + } | |
| 33308 | + | |
| 33309 | + if (!(url instanceof URL)) { | |
| 33310 | + if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { | |
| 33311 | + throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') | |
| 33312 | + } | |
| 33313 | + | |
| 33314 | + if (url.path != null && typeof url.path !== 'string') { | |
| 33315 | + throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') | |
| 33316 | + } | |
| 33317 | + | |
| 33318 | + if (url.pathname != null && typeof url.pathname !== 'string') { | |
| 33319 | + throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') | |
| 33320 | + } | |
| 33321 | + | |
| 33322 | + if (url.hostname != null && typeof url.hostname !== 'string') { | |
| 33323 | + throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') | |
| 33324 | + } | |
| 33325 | + | |
| 33326 | + if (url.origin != null && typeof url.origin !== 'string') { | |
| 33327 | + throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') | |
| 33328 | + } | |
| 33329 | + | |
| 33330 | + const port = url.port != null | |
| 33331 | + ? url.port | |
| 33332 | + : (url.protocol === 'https:' ? 443 : 80) | |
| 33333 | + let origin = url.origin != null | |
| 33334 | + ? url.origin | |
| 33335 | + : `${url.protocol}//${url.hostname}:${port}` | |
| 33336 | + let path = url.path != null | |
| 33337 | + ? url.path | |
| 33338 | + : `${url.pathname || ''}${url.search || ''}` | |
| 33339 | + | |
| 33340 | + if (origin.endsWith('/')) { | |
| 33341 | + origin = origin.substring(0, origin.length - 1) | |
| 33342 | + } | |
| 33343 | + | |
| 33344 | + if (path && !path.startsWith('/')) { | |
| 33345 | + path = `/${path}` | |
| 33346 | + } | |
| 33347 | + // new URL(path, origin) is unsafe when `path` contains an absolute URL | |
| 33348 | + // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: | |
| 33349 | + // If first parameter is a relative URL, second param is required, and will be used as the base URL. | |
| 33350 | + // If first parameter is an absolute URL, a given second param will be ignored. | |
| 33351 | + url = new URL(origin + path) | |
| 33352 | + } | |
| 33353 | + | |
| 33354 | + return url | |
| 33355 | +} | |
| 33356 | + | |
| 33357 | +function parseOrigin (url) { | |
| 33358 | + url = parseURL(url) | |
| 33359 | + | |
| 33360 | + if (url.pathname !== '/' || url.search || url.hash) { | |
| 33361 | + throw new InvalidArgumentError('invalid url') | |
| 33362 | + } | |
| 33363 | + | |
| 33364 | + return url | |
| 33365 | +} | |
| 33366 | + | |
| 33367 | +function getHostname (host) { | |
| 33368 | + if (host[0] === '[') { | |
| 33369 | + const idx = host.indexOf(']') | |
| 33370 | + | |
| 33371 | + assert(idx !== -1) | |
| 33372 | + return host.substring(1, idx) | |
| 33373 | + } | |
| 33374 | + | |
| 33375 | + const idx = host.indexOf(':') | |
| 33376 | + if (idx === -1) return host | |
| 33377 | + | |
| 33378 | + return host.substring(0, idx) | |
| 33379 | +} | |
| 33380 | + | |
| 33381 | +// IP addresses are not valid server names per RFC6066 | |
| 33382 | +// > Currently, the only server names supported are DNS hostnames | |
| 33383 | +function getServerName (host) { | |
| 33384 | + if (!host) { | |
| 33385 | + return null | |
| 33386 | + } | |
| 33387 | + | |
| 33388 | + assert.strictEqual(typeof host, 'string') | |
| 33389 | + | |
| 33390 | + const servername = getHostname(host) | |
| 33391 | + if (net.isIP(servername)) { | |
| 33392 | + return '' | |
| 33393 | + } | |
| 33394 | + | |
| 33395 | + return servername | |
| 33396 | +} | |
| 33397 | + | |
| 33398 | +function deepClone (obj) { | |
| 33399 | + return JSON.parse(JSON.stringify(obj)) | |
| 33400 | +} | |
| 33401 | + | |
| 33402 | +function isAsyncIterable (obj) { | |
| 33403 | + return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') | |
| 33404 | +} | |
| 33405 | + | |
| 33406 | +function isIterable (obj) { | |
| 33407 | + return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) | |
| 33408 | +} | |
| 33409 | + | |
| 33410 | +function bodyLength (body) { | |
| 33411 | + if (body == null) { | |
| 33412 | + return 0 | |
| 33413 | + } else if (isStream(body)) { | |
| 33414 | + const state = body._readableState | |
| 33415 | + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) | |
| 33416 | + ? state.length | |
| 33417 | + : null | |
| 33418 | + } else if (isBlobLike(body)) { | |
| 33419 | + return body.size != null ? body.size : null | |
| 33420 | + } else if (isBuffer(body)) { | |
| 33421 | + return body.byteLength | |
| 33422 | + } | |
| 33423 | + | |
| 33424 | + return null | |
| 33425 | +} | |
| 33426 | + | |
| 33427 | +function isDestroyed (stream) { | |
| 33428 | + return !stream || !!(stream.destroyed || stream[kDestroyed]) | |
| 33429 | +} | |
| 33430 | + | |
| 33431 | +function isReadableAborted (stream) { | |
| 33432 | + const state = stream && stream._readableState | |
| 33433 | + return isDestroyed(stream) && state && !state.endEmitted | |
| 33434 | +} | |
| 33435 | + | |
| 33436 | +function destroy (stream, err) { | |
| 33437 | + if (stream == null || !isStream(stream) || isDestroyed(stream)) { | |
| 33438 | + return | |
| 33439 | + } | |
| 33440 | + | |
| 33441 | + if (typeof stream.destroy === 'function') { | |
| 33442 | + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { | |
| 33443 | + // See: https://github.com/nodejs/node/pull/38505/files | |
| 33444 | + stream.socket = null | |
| 33445 | + } | |
| 33446 | + | |
| 33447 | + stream.destroy(err) | |
| 33448 | + } else if (err) { | |
| 33449 | + process.nextTick((stream, err) => { | |
| 33450 | + stream.emit('error', err) | |
| 33451 | + }, stream, err) | |
| 33452 | + } | |
| 33453 | + | |
| 33454 | + if (stream.destroyed !== true) { | |
| 33455 | + stream[kDestroyed] = true | |
| 33456 | + } | |
| 33457 | +} | |
| 33458 | + | |
| 33459 | +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ | |
| 33460 | +function parseKeepAliveTimeout (val) { | |
| 33461 | + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) | |
| 33462 | + return m ? parseInt(m[1], 10) * 1000 : null | |
| 33463 | +} | |
| 33464 | + | |
| 33465 | +/** | |
| 33466 | + * Retrieves a header name and returns its lowercase value. | |
| 33467 | + * @param {string | Buffer} value Header name | |
| 33468 | + * @returns {string} | |
| 33469 | + */ | |
| 33470 | +function headerNameToString (value) { | |
| 33471 | + return headerNameLowerCasedRecord[value] || value.toLowerCase() | |
| 33472 | +} | |
| 33473 | + | |
| 33474 | +function parseHeaders (headers, obj = {}) { | |
| 33475 | + // For H2 support | |
| 33476 | + if (!Array.isArray(headers)) return headers | |
| 33477 | + | |
| 33478 | + for (let i = 0; i < headers.length; i += 2) { | |
| 33479 | + const key = headers[i].toString().toLowerCase() | |
| 33480 | + let val = obj[key] | |
| 33481 | + | |
| 33482 | + if (!val) { | |
| 33483 | + if (Array.isArray(headers[i + 1])) { | |
| 33484 | + obj[key] = headers[i + 1].map(x => x.toString('utf8')) | |
| 33485 | + } else { | |
| 33486 | + obj[key] = headers[i + 1].toString('utf8') | |
| 33487 | + } | |
| 33488 | + } else { | |
| 33489 | + if (!Array.isArray(val)) { | |
| 33490 | + val = [val] | |
| 33491 | + obj[key] = val | |
| 33492 | + } | |
| 33493 | + val.push(headers[i + 1].toString('utf8')) | |
| 33494 | + } | |
| 33495 | + } | |
| 33496 | + | |
| 33497 | + // See https://github.com/nodejs/node/pull/46528 | |
| 33498 | + if ('content-length' in obj && 'content-disposition' in obj) { | |
| 33499 | + obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') | |
| 33500 | + } | |
| 33501 | + | |
| 33502 | + return obj | |
| 33503 | +} | |
| 33504 | + | |
| 33505 | +function parseRawHeaders (headers) { | |
| 33506 | + const ret = [] | |
| 33507 | + let hasContentLength = false | |
| 33508 | + let contentDispositionIdx = -1 | |
| 33509 | + | |
| 33510 | + for (let n = 0; n < headers.length; n += 2) { | |
| 33511 | + const key = headers[n + 0].toString() | |
| 33512 | + const val = headers[n + 1].toString('utf8') | |
| 33513 | + | |
| 33514 | + if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { | |
| 33515 | + ret.push(key, val) | |
| 33516 | + hasContentLength = true | |
| 33517 | + } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { | |
| 33518 | + contentDispositionIdx = ret.push(key, val) - 1 | |
| 33519 | + } else { | |
| 33520 | + ret.push(key, val) | |
| 33521 | + } | |
| 33522 | + } | |
| 33523 | + | |
| 33524 | + // See https://github.com/nodejs/node/pull/46528 | |
| 33525 | + if (hasContentLength && contentDispositionIdx !== -1) { | |
| 33526 | + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') | |
| 33527 | + } | |
| 33528 | + | |
| 33529 | + return ret | |
| 33530 | +} | |
| 33531 | + | |
| 33532 | +function isBuffer (buffer) { | |
| 33533 | + // See, https://github.com/mcollina/undici/pull/319 | |
| 33534 | + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) | |
| 33535 | +} | |
| 33536 | + | |
| 33537 | +function validateHandler (handler, method, upgrade) { | |
| 33538 | + if (!handler || typeof handler !== 'object') { | |
| 33539 | + throw new InvalidArgumentError('handler must be an object') | |
| 33540 | + } | |
| 33541 | + | |
| 33542 | + if (typeof handler.onConnect !== 'function') { | |
| 33543 | + throw new InvalidArgumentError('invalid onConnect method') | |
| 33544 | + } | |
| 33545 | + | |
| 33546 | + if (typeof handler.onError !== 'function') { | |
| 33547 | + throw new InvalidArgumentError('invalid onError method') | |
| 33548 | + } | |
| 33549 | + | |
| 33550 | + if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { | |
| 33551 | + throw new InvalidArgumentError('invalid onBodySent method') | |
| 33552 | + } | |
| 33553 | + | |
| 33554 | + if (upgrade || method === 'CONNECT') { | |
| 33555 | + if (typeof handler.onUpgrade !== 'function') { | |
| 33556 | + throw new InvalidArgumentError('invalid onUpgrade method') | |
| 33557 | + } | |
| 33558 | + } else { | |
| 33559 | + if (typeof handler.onHeaders !== 'function') { | |
| 33560 | + throw new InvalidArgumentError('invalid onHeaders method') | |
| 33561 | + } | |
| 33562 | + | |
| 33563 | + if (typeof handler.onData !== 'function') { | |
| 33564 | + throw new InvalidArgumentError('invalid onData method') | |
| 33565 | + } | |
| 33566 | + | |
| 33567 | + if (typeof handler.onComplete !== 'function') { | |
| 33568 | + throw new InvalidArgumentError('invalid onComplete method') | |
| 33569 | + } | |
| 33570 | + } | |
| 33571 | +} | |
| 33572 | + | |
| 33573 | +// A body is disturbed if it has been read from and it cannot | |
| 33574 | +// be re-used without losing state or data. | |
| 33575 | +function isDisturbed (body) { | |
| 33576 | + return !!(body && ( | |
| 33577 | + stream.isDisturbed | |
| 33578 | + ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? | |
| 33579 | + : body[kBodyUsed] || | |
| 33580 | + body.readableDidRead || | |
| 33581 | + (body._readableState && body._readableState.dataEmitted) || | |
| 33582 | + isReadableAborted(body) | |
| 33583 | + )) | |
| 33584 | +} | |
| 33585 | + | |
| 33586 | +function isErrored (body) { | |
| 33587 | + return !!(body && ( | |
| 33588 | + stream.isErrored | |
| 33589 | + ? stream.isErrored(body) | |
| 33590 | + : /state: 'errored'/.test(nodeUtil.inspect(body) | |
| 33591 | + ))) | |
| 33592 | +} | |
| 33593 | + | |
| 33594 | +function isReadable (body) { | |
| 33595 | + return !!(body && ( | |
| 33596 | + stream.isReadable | |
| 33597 | + ? stream.isReadable(body) | |
| 33598 | + : /state: 'readable'/.test(nodeUtil.inspect(body) | |
| 33599 | + ))) | |
| 33600 | +} | |
| 33601 | + | |
| 33602 | +function getSocketInfo (socket) { | |
| 33603 | + return { | |
| 33604 | + localAddress: socket.localAddress, | |
| 33605 | + localPort: socket.localPort, | |
| 33606 | + remoteAddress: socket.remoteAddress, | |
| 33607 | + remotePort: socket.remotePort, | |
| 33608 | + remoteFamily: socket.remoteFamily, | |
| 33609 | + timeout: socket.timeout, | |
| 33610 | + bytesWritten: socket.bytesWritten, | |
| 33611 | + bytesRead: socket.bytesRead | |
| 33612 | + } | |
| 33613 | +} | |
| 33614 | + | |
| 33615 | +async function * convertIterableToBuffer (iterable) { | |
| 33616 | + for await (const chunk of iterable) { | |
| 33617 | + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) | |
| 33618 | + } | |
| 33619 | +} | |
| 33620 | + | |
| 33621 | +let ReadableStream | |
| 33622 | +function ReadableStreamFrom (iterable) { | |
| 33623 | + if (!ReadableStream) { | |
| 33624 | + ReadableStream = (__nccwpck_require__(3774).ReadableStream) | |
| 33625 | + } | |
| 33626 | + | |
| 33627 | + if (ReadableStream.from) { | |
| 33628 | + return ReadableStream.from(convertIterableToBuffer(iterable)) | |
| 33629 | + } | |
| 33630 | + | |
| 33631 | + let iterator | |
| 33632 | + return new ReadableStream( | |
| 33633 | + { | |
| 33634 | + async start () { | |
| 33635 | + iterator = iterable[Symbol.asyncIterator]() | |
| 33636 | + }, | |
| 33637 | + async pull (controller) { | |
| 33638 | + const { done, value } = await iterator.next() | |
| 33639 | + if (done) { | |
| 33640 | + queueMicrotask(() => { | |
| 33641 | + controller.close() | |
| 33642 | + }) | |
| 33643 | + } else { | |
| 33644 | + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) | |
| 33645 | + controller.enqueue(new Uint8Array(buf)) | |
| 33646 | + } | |
| 33647 | + return controller.desiredSize > 0 | |
| 33648 | + }, | |
| 33649 | + async cancel (reason) { | |
| 33650 | + await iterator.return() | |
| 33651 | + } | |
| 33652 | + }, | |
| 33653 | + 0 | |
| 33654 | + ) | |
| 33655 | +} | |
| 33656 | + | |
| 33657 | +// The chunk should be a FormData instance and contains | |
| 33658 | +// all the required methods. | |
| 33659 | +function isFormDataLike (object) { | |
| 33660 | + return ( | |
| 33661 | + object && | |
| 33662 | + typeof object === 'object' && | |
| 33663 | + typeof object.append === 'function' && | |
| 33664 | + typeof object.delete === 'function' && | |
| 33665 | + typeof object.get === 'function' && | |
| 33666 | + typeof object.getAll === 'function' && | |
| 33667 | + typeof object.has === 'function' && | |
| 33668 | + typeof object.set === 'function' && | |
| 33669 | + object[Symbol.toStringTag] === 'FormData' | |
| 33670 | + ) | |
| 33671 | +} | |
| 33672 | + | |
| 33673 | +function throwIfAborted (signal) { | |
| 33674 | + if (!signal) { return } | |
| 33675 | + if (typeof signal.throwIfAborted === 'function') { | |
| 33676 | + signal.throwIfAborted() | |
| 33677 | + } else { | |
| 33678 | + if (signal.aborted) { | |
| 33679 | + // DOMException not available < v17.0.0 | |
| 33680 | + const err = new Error('The operation was aborted') | |
| 33681 | + err.name = 'AbortError' | |
| 33682 | + throw err | |
| 33683 | + } | |
| 33684 | + } | |
| 33685 | +} | |
| 33686 | + | |
| 33687 | +function addAbortListener (signal, listener) { | |
| 33688 | + if ('addEventListener' in signal) { | |
| 33689 | + signal.addEventListener('abort', listener, { once: true }) | |
| 33690 | + return () => signal.removeEventListener('abort', listener) | |
| 33691 | + } | |
| 33692 | + signal.addListener('abort', listener) | |
| 33693 | + return () => signal.removeListener('abort', listener) | |
| 33694 | +} | |
| 33695 | + | |
| 33696 | +const hasToWellFormed = !!String.prototype.toWellFormed | |
| 33697 | + | |
| 33698 | +/** | |
| 33699 | + * @param {string} val | |
| 33700 | + */ | |
| 33701 | +function toUSVString (val) { | |
| 33702 | + if (hasToWellFormed) { | |
| 33703 | + return `${val}`.toWellFormed() | |
| 33704 | + } else if (nodeUtil.toUSVString) { | |
| 33705 | + return nodeUtil.toUSVString(val) | |
| 33706 | + } | |
| 33707 | + | |
| 33708 | + return `${val}` | |
| 33709 | +} | |
| 33710 | + | |
| 33711 | +// Parsed accordingly to RFC 9110 | |
| 33712 | +// https://www.rfc-editor.org/rfc/rfc9110#field.content-range | |
| 33713 | +function parseRangeHeader (range) { | |
| 33714 | + if (range == null || range === '') return { start: 0, end: null, size: null } | |
| 33715 | + | |
| 33716 | + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null | |
| 33717 | + return m | |
| 33718 | + ? { | |
| 33719 | + start: parseInt(m[1]), | |
| 33720 | + end: m[2] ? parseInt(m[2]) : null, | |
| 33721 | + size: m[3] ? parseInt(m[3]) : null | |
| 33722 | + } | |
| 33723 | + : null | |
| 33724 | +} | |
| 33725 | + | |
| 33726 | +const kEnumerableProperty = Object.create(null) | |
| 33727 | +kEnumerableProperty.enumerable = true | |
| 33728 | + | |
| 33729 | +module.exports = { | |
| 33730 | + kEnumerableProperty, | |
| 33731 | + nop, | |
| 33732 | + isDisturbed, | |
| 33733 | + isErrored, | |
| 33734 | + isReadable, | |
| 33735 | + toUSVString, | |
| 33736 | + isReadableAborted, | |
| 33737 | + isBlobLike, | |
| 33738 | + parseOrigin, | |
| 33739 | + parseURL, | |
| 33740 | + getServerName, | |
| 33741 | + isStream, | |
| 33742 | + isIterable, | |
| 33743 | + isAsyncIterable, | |
| 33744 | + isDestroyed, | |
| 33745 | + headerNameToString, | |
| 33746 | + parseRawHeaders, | |
| 33747 | + parseHeaders, | |
| 33748 | + parseKeepAliveTimeout, | |
| 33749 | + destroy, | |
| 33750 | + bodyLength, | |
| 33751 | + deepClone, | |
| 33752 | + ReadableStreamFrom, | |
| 33753 | + isBuffer, | |
| 33754 | + validateHandler, | |
| 33755 | + getSocketInfo, | |
| 33756 | + isFormDataLike, | |
| 33757 | + buildURL, | |
| 33758 | + throwIfAborted, | |
| 33759 | + addAbortListener, | |
| 33760 | + parseRangeHeader, | |
| 33761 | + nodeMajor, | |
| 33762 | + nodeMinor, | |
| 33763 | + nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), | |
| 33764 | + safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] | |
| 33765 | +} | |
| 33766 | + | |
| 33767 | + | |
| 33768 | +/***/ }), | |
| 33769 | + | |
| 33770 | +/***/ 1: | |
| 33771 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 33772 | + | |
| 33773 | +"use strict"; | |
| 33774 | + | |
| 33775 | + | |
| 33776 | +const Dispatcher = __nccwpck_require__(992) | |
| 33777 | +const { | |
| 33778 | + ClientDestroyedError, | |
| 33779 | + ClientClosedError, | |
| 33780 | + InvalidArgumentError | |
| 33781 | +} = __nccwpck_require__(8707) | |
| 33782 | +const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(6443) | |
| 33783 | + | |
| 33784 | +const kDestroyed = Symbol('destroyed') | |
| 33785 | +const kClosed = Symbol('closed') | |
| 33786 | +const kOnDestroyed = Symbol('onDestroyed') | |
| 33787 | +const kOnClosed = Symbol('onClosed') | |
| 33788 | +const kInterceptedDispatch = Symbol('Intercepted Dispatch') | |
| 33789 | + | |
| 33790 | +class DispatcherBase extends Dispatcher { | |
| 33791 | + constructor () { | |
| 33792 | + super() | |
| 33793 | + | |
| 33794 | + this[kDestroyed] = false | |
| 33795 | + this[kOnDestroyed] = null | |
| 33796 | + this[kClosed] = false | |
| 33797 | + this[kOnClosed] = [] | |
| 33798 | + } | |
| 33799 | + | |
| 33800 | + get destroyed () { | |
| 33801 | + return this[kDestroyed] | |
| 33802 | + } | |
| 33803 | + | |
| 33804 | + get closed () { | |
| 33805 | + return this[kClosed] | |
| 33806 | + } | |
| 33807 | + | |
| 33808 | + get interceptors () { | |
| 33809 | + return this[kInterceptors] | |
| 33810 | + } | |
| 33811 | + | |
| 33812 | + set interceptors (newInterceptors) { | |
| 33813 | + if (newInterceptors) { | |
| 33814 | + for (let i = newInterceptors.length - 1; i >= 0; i--) { | |
| 33815 | + const interceptor = this[kInterceptors][i] | |
| 33816 | + if (typeof interceptor !== 'function') { | |
| 33817 | + throw new InvalidArgumentError('interceptor must be an function') | |
| 33818 | + } | |
| 33819 | + } | |
| 33820 | + } | |
| 33821 | + | |
| 33822 | + this[kInterceptors] = newInterceptors | |
| 33823 | + } | |
| 33824 | + | |
| 33825 | + close (callback) { | |
| 33826 | + if (callback === undefined) { | |
| 33827 | + return new Promise((resolve, reject) => { | |
| 33828 | + this.close((err, data) => { | |
| 33829 | + return err ? reject(err) : resolve(data) | |
| 33830 | + }) | |
| 33831 | + }) | |
| 33832 | + } | |
| 33833 | + | |
| 33834 | + if (typeof callback !== 'function') { | |
| 33835 | + throw new InvalidArgumentError('invalid callback') | |
| 33836 | + } | |
| 33837 | + | |
| 33838 | + if (this[kDestroyed]) { | |
| 33839 | + queueMicrotask(() => callback(new ClientDestroyedError(), null)) | |
| 33840 | + return | |
| 33841 | + } | |
| 33842 | + | |
| 33843 | + if (this[kClosed]) { | |
| 33844 | + if (this[kOnClosed]) { | |
| 33845 | + this[kOnClosed].push(callback) | |
| 33846 | + } else { | |
| 33847 | + queueMicrotask(() => callback(null, null)) | |
| 33848 | + } | |
| 33849 | + return | |
| 33850 | + } | |
| 33851 | + | |
| 33852 | + this[kClosed] = true | |
| 33853 | + this[kOnClosed].push(callback) | |
| 33854 | + | |
| 33855 | + const onClosed = () => { | |
| 33856 | + const callbacks = this[kOnClosed] | |
| 33857 | + this[kOnClosed] = null | |
| 33858 | + for (let i = 0; i < callbacks.length; i++) { | |
| 33859 | + callbacks[i](null, null) | |
| 33860 | + } | |
| 33861 | + } | |
| 33862 | + | |
| 33863 | + // Should not error. | |
| 33864 | + this[kClose]() | |
| 33865 | + .then(() => this.destroy()) | |
| 33866 | + .then(() => { | |
| 33867 | + queueMicrotask(onClosed) | |
| 33868 | + }) | |
| 33869 | + } | |
| 33870 | + | |
| 33871 | + destroy (err, callback) { | |
| 33872 | + if (typeof err === 'function') { | |
| 33873 | + callback = err | |
| 33874 | + err = null | |
| 33875 | + } | |
| 33876 | + | |
| 33877 | + if (callback === undefined) { | |
| 33878 | + return new Promise((resolve, reject) => { | |
| 33879 | + this.destroy(err, (err, data) => { | |
| 33880 | + return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) | |
| 33881 | + }) | |
| 33882 | + }) | |
| 33883 | + } | |
| 33884 | + | |
| 33885 | + if (typeof callback !== 'function') { | |
| 33886 | + throw new InvalidArgumentError('invalid callback') | |
| 33887 | + } | |
| 33888 | + | |
| 33889 | + if (this[kDestroyed]) { | |
| 33890 | + if (this[kOnDestroyed]) { | |
| 33891 | + this[kOnDestroyed].push(callback) | |
| 33892 | + } else { | |
| 33893 | + queueMicrotask(() => callback(null, null)) | |
| 33894 | + } | |
| 33895 | + return | |
| 33896 | + } | |
| 33897 | + | |
| 33898 | + if (!err) { | |
| 33899 | + err = new ClientDestroyedError() | |
| 33900 | + } | |
| 33901 | + | |
| 33902 | + this[kDestroyed] = true | |
| 33903 | + this[kOnDestroyed] = this[kOnDestroyed] || [] | |
| 33904 | + this[kOnDestroyed].push(callback) | |
| 33905 | + | |
| 33906 | + const onDestroyed = () => { | |
| 33907 | + const callbacks = this[kOnDestroyed] | |
| 33908 | + this[kOnDestroyed] = null | |
| 33909 | + for (let i = 0; i < callbacks.length; i++) { | |
| 33910 | + callbacks[i](null, null) | |
| 33911 | + } | |
| 33912 | + } | |
| 33913 | + | |
| 33914 | + // Should not error. | |
| 33915 | + this[kDestroy](err).then(() => { | |
| 33916 | + queueMicrotask(onDestroyed) | |
| 33917 | + }) | |
| 33918 | + } | |
| 33919 | + | |
| 33920 | + [kInterceptedDispatch] (opts, handler) { | |
| 33921 | + if (!this[kInterceptors] || this[kInterceptors].length === 0) { | |
| 33922 | + this[kInterceptedDispatch] = this[kDispatch] | |
| 33923 | + return this[kDispatch](opts, handler) | |
| 33924 | + } | |
| 33925 | + | |
| 33926 | + let dispatch = this[kDispatch].bind(this) | |
| 33927 | + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { | |
| 33928 | + dispatch = this[kInterceptors][i](dispatch) | |
| 33929 | + } | |
| 33930 | + this[kInterceptedDispatch] = dispatch | |
| 33931 | + return dispatch(opts, handler) | |
| 33932 | + } | |
| 33933 | + | |
| 33934 | + dispatch (opts, handler) { | |
| 33935 | + if (!handler || typeof handler !== 'object') { | |
| 33936 | + throw new InvalidArgumentError('handler must be an object') | |
| 33937 | + } | |
| 33938 | + | |
| 33939 | + try { | |
| 33940 | + if (!opts || typeof opts !== 'object') { | |
| 33941 | + throw new InvalidArgumentError('opts must be an object.') | |
| 33942 | + } | |
| 33943 | + | |
| 33944 | + if (this[kDestroyed] || this[kOnDestroyed]) { | |
| 33945 | + throw new ClientDestroyedError() | |
| 33946 | + } | |
| 33947 | + | |
| 33948 | + if (this[kClosed]) { | |
| 33949 | + throw new ClientClosedError() | |
| 33950 | + } | |
| 33951 | + | |
| 33952 | + return this[kInterceptedDispatch](opts, handler) | |
| 33953 | + } catch (err) { | |
| 33954 | + if (typeof handler.onError !== 'function') { | |
| 33955 | + throw new InvalidArgumentError('invalid onError method') | |
| 33956 | + } | |
| 33957 | + | |
| 33958 | + handler.onError(err) | |
| 33959 | + | |
| 33960 | + return false | |
| 33961 | + } | |
| 33962 | + } | |
| 33963 | +} | |
| 33964 | + | |
| 33965 | +module.exports = DispatcherBase | |
| 33966 | + | |
| 33967 | + | |
| 33968 | +/***/ }), | |
| 33969 | + | |
| 33970 | +/***/ 992: | |
| 33971 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 33972 | + | |
| 33973 | +"use strict"; | |
| 33974 | + | |
| 33975 | + | |
| 33976 | +const EventEmitter = __nccwpck_require__(4434) | |
| 33977 | + | |
| 33978 | +class Dispatcher extends EventEmitter { | |
| 33979 | + dispatch () { | |
| 33980 | + throw new Error('not implemented') | |
| 33981 | + } | |
| 33982 | + | |
| 33983 | + close () { | |
| 33984 | + throw new Error('not implemented') | |
| 33985 | + } | |
| 33986 | + | |
| 33987 | + destroy () { | |
| 33988 | + throw new Error('not implemented') | |
| 33989 | + } | |
| 33990 | +} | |
| 33991 | + | |
| 33992 | +module.exports = Dispatcher | |
| 33993 | + | |
| 33994 | + | |
| 33995 | +/***/ }), | |
| 33996 | + | |
| 33997 | +/***/ 8923: | |
| 33998 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 33999 | + | |
| 34000 | +"use strict"; | |
| 34001 | + | |
| 34002 | + | |
| 34003 | +const Busboy = __nccwpck_require__(9581) | |
| 34004 | +const util = __nccwpck_require__(3440) | |
| 34005 | +const { | |
| 34006 | + ReadableStreamFrom, | |
| 34007 | + isBlobLike, | |
| 34008 | + isReadableStreamLike, | |
| 34009 | + readableStreamClose, | |
| 34010 | + createDeferredPromise, | |
| 34011 | + fullyReadBody | |
| 34012 | +} = __nccwpck_require__(5523) | |
| 34013 | +const { FormData } = __nccwpck_require__(3073) | |
| 34014 | +const { kState } = __nccwpck_require__(9710) | |
| 34015 | +const { webidl } = __nccwpck_require__(4222) | |
| 34016 | +const { DOMException, structuredClone } = __nccwpck_require__(7326) | |
| 34017 | +const { Blob, File: NativeFile } = __nccwpck_require__(181) | |
| 34018 | +const { kBodyUsed } = __nccwpck_require__(6443) | |
| 34019 | +const assert = __nccwpck_require__(2613) | |
| 34020 | +const { isErrored } = __nccwpck_require__(3440) | |
| 34021 | +const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253) | |
| 34022 | +const { File: UndiciFile } = __nccwpck_require__(3041) | |
| 34023 | +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) | |
| 34024 | + | |
| 34025 | +let random | |
| 34026 | +try { | |
| 34027 | + const crypto = __nccwpck_require__(7598) | |
| 34028 | + random = (max) => crypto.randomInt(0, max) | |
| 34029 | +} catch { | |
| 34030 | + random = (max) => Math.floor(Math.random(max)) | |
| 34031 | +} | |
| 34032 | + | |
| 34033 | +let ReadableStream = globalThis.ReadableStream | |
| 34034 | + | |
| 34035 | +/** @type {globalThis['File']} */ | |
| 34036 | +const File = NativeFile ?? UndiciFile | |
| 34037 | +const textEncoder = new TextEncoder() | |
| 34038 | +const textDecoder = new TextDecoder() | |
| 34039 | + | |
| 34040 | +// https://fetch.spec.whatwg.org/#concept-bodyinit-extract | |
| 34041 | +function extractBody (object, keepalive = false) { | |
| 34042 | + if (!ReadableStream) { | |
| 34043 | + ReadableStream = (__nccwpck_require__(3774).ReadableStream) | |
| 34044 | + } | |
| 34045 | + | |
| 34046 | + // 1. Let stream be null. | |
| 34047 | + let stream = null | |
| 34048 | + | |
| 34049 | + // 2. If object is a ReadableStream object, then set stream to object. | |
| 34050 | + if (object instanceof ReadableStream) { | |
| 34051 | + stream = object | |
| 34052 | + } else if (isBlobLike(object)) { | |
| 34053 | + // 3. Otherwise, if object is a Blob object, set stream to the | |
| 34054 | + // result of running object’s get stream. | |
| 34055 | + stream = object.stream() | |
| 34056 | + } else { | |
| 34057 | + // 4. Otherwise, set stream to a new ReadableStream object, and set | |
| 34058 | + // up stream. | |
| 34059 | + stream = new ReadableStream({ | |
| 34060 | + async pull (controller) { | |
| 34061 | + controller.enqueue( | |
| 34062 | + typeof source === 'string' ? textEncoder.encode(source) : source | |
| 34063 | + ) | |
| 34064 | + queueMicrotask(() => readableStreamClose(controller)) | |
| 34065 | + }, | |
| 34066 | + start () {}, | |
| 34067 | + type: undefined | |
| 34068 | + }) | |
| 34069 | + } | |
| 34070 | + | |
| 34071 | + // 5. Assert: stream is a ReadableStream object. | |
| 34072 | + assert(isReadableStreamLike(stream)) | |
| 34073 | + | |
| 34074 | + // 6. Let action be null. | |
| 34075 | + let action = null | |
| 34076 | + | |
| 34077 | + // 7. Let source be null. | |
| 34078 | + let source = null | |
| 34079 | + | |
| 34080 | + // 8. Let length be null. | |
| 34081 | + let length = null | |
| 34082 | + | |
| 34083 | + // 9. Let type be null. | |
| 34084 | + let type = null | |
| 34085 | + | |
| 34086 | + // 10. Switch on object: | |
| 34087 | + if (typeof object === 'string') { | |
| 34088 | + // Set source to the UTF-8 encoding of object. | |
| 34089 | + // Note: setting source to a Uint8Array here breaks some mocking assumptions. | |
| 34090 | + source = object | |
| 34091 | + | |
| 34092 | + // Set type to `text/plain;charset=UTF-8`. | |
| 34093 | + type = 'text/plain;charset=UTF-8' | |
| 34094 | + } else if (object instanceof URLSearchParams) { | |
| 34095 | + // URLSearchParams | |
| 34096 | + | |
| 34097 | + // spec says to run application/x-www-form-urlencoded on body.list | |
| 34098 | + // this is implemented in Node.js as apart of an URLSearchParams instance toString method | |
| 34099 | + // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 | |
| 34100 | + // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 | |
| 34101 | + | |
| 34102 | + // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. | |
| 34103 | + source = object.toString() | |
| 34104 | + | |
| 34105 | + // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. | |
| 34106 | + type = 'application/x-www-form-urlencoded;charset=UTF-8' | |
| 34107 | + } else if (isArrayBuffer(object)) { | |
| 34108 | + // BufferSource/ArrayBuffer | |
| 34109 | + | |
| 34110 | + // Set source to a copy of the bytes held by object. | |
| 34111 | + source = new Uint8Array(object.slice()) | |
| 34112 | + } else if (ArrayBuffer.isView(object)) { | |
| 34113 | + // BufferSource/ArrayBufferView | |
| 34114 | + | |
| 34115 | + // Set source to a copy of the bytes held by object. | |
| 34116 | + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) | |
| 34117 | + } else if (util.isFormDataLike(object)) { | |
| 34118 | + const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}` | |
| 34119 | + const prefix = `--${boundary}\r\nContent-Disposition: form-data` | |
| 34120 | + | |
| 34121 | + /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ | |
| 34122 | + const escape = (str) => | |
| 34123 | + str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') | |
| 34124 | + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') | |
| 34125 | + | |
| 34126 | + // Set action to this step: run the multipart/form-data | |
| 34127 | + // encoding algorithm, with object’s entry list and UTF-8. | |
| 34128 | + // - This ensures that the body is immutable and can't be changed afterwords | |
| 34129 | + // - That the content-length is calculated in advance. | |
| 34130 | + // - And that all parts are pre-encoded and ready to be sent. | |
| 34131 | + | |
| 34132 | + const blobParts = [] | |
| 34133 | + const rn = new Uint8Array([13, 10]) // '\r\n' | |
| 34134 | + length = 0 | |
| 34135 | + let hasUnknownSizeValue = false | |
| 34136 | + | |
| 34137 | + for (const [name, value] of object) { | |
| 34138 | + if (typeof value === 'string') { | |
| 34139 | + const chunk = textEncoder.encode(prefix + | |
| 34140 | + `; name="${escape(normalizeLinefeeds(name))}"` + | |
| 34141 | + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) | |
| 34142 | + blobParts.push(chunk) | |
| 34143 | + length += chunk.byteLength | |
| 34144 | + } else { | |
| 34145 | + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + | |
| 34146 | + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + | |
| 34147 | + `Content-Type: ${ | |
| 34148 | + value.type || 'application/octet-stream' | |
| 34149 | + }\r\n\r\n`) | |
| 34150 | + blobParts.push(chunk, value, rn) | |
| 34151 | + if (typeof value.size === 'number') { | |
| 34152 | + length += chunk.byteLength + value.size + rn.byteLength | |
| 34153 | + } else { | |
| 34154 | + hasUnknownSizeValue = true | |
| 34155 | + } | |
| 34156 | + } | |
| 34157 | + } | |
| 34158 | + | |
| 34159 | + const chunk = textEncoder.encode(`--${boundary}--`) | |
| 34160 | + blobParts.push(chunk) | |
| 34161 | + length += chunk.byteLength | |
| 34162 | + if (hasUnknownSizeValue) { | |
| 34163 | + length = null | |
| 34164 | + } | |
| 34165 | + | |
| 34166 | + // Set source to object. | |
| 34167 | + source = object | |
| 34168 | + | |
| 34169 | + action = async function * () { | |
| 34170 | + for (const part of blobParts) { | |
| 34171 | + if (part.stream) { | |
| 34172 | + yield * part.stream() | |
| 34173 | + } else { | |
| 34174 | + yield part | |
| 34175 | + } | |
| 34176 | + } | |
| 34177 | + } | |
| 34178 | + | |
| 34179 | + // Set type to `multipart/form-data; boundary=`, | |
| 34180 | + // followed by the multipart/form-data boundary string generated | |
| 34181 | + // by the multipart/form-data encoding algorithm. | |
| 34182 | + type = 'multipart/form-data; boundary=' + boundary | |
| 34183 | + } else if (isBlobLike(object)) { | |
| 34184 | + // Blob | |
| 34185 | + | |
| 34186 | + // Set source to object. | |
| 34187 | + source = object | |
| 34188 | + | |
| 34189 | + // Set length to object’s size. | |
| 34190 | + length = object.size | |
| 34191 | + | |
| 34192 | + // If object’s type attribute is not the empty byte sequence, set | |
| 34193 | + // type to its value. | |
| 34194 | + if (object.type) { | |
| 34195 | + type = object.type | |
| 34196 | + } | |
| 34197 | + } else if (typeof object[Symbol.asyncIterator] === 'function') { | |
| 34198 | + // If keepalive is true, then throw a TypeError. | |
| 34199 | + if (keepalive) { | |
| 34200 | + throw new TypeError('keepalive') | |
| 34201 | + } | |
| 34202 | + | |
| 34203 | + // If object is disturbed or locked, then throw a TypeError. | |
| 34204 | + if (util.isDisturbed(object) || object.locked) { | |
| 34205 | + throw new TypeError( | |
| 34206 | + 'Response body object should not be disturbed or locked' | |
| 34207 | + ) | |
| 34208 | + } | |
| 34209 | + | |
| 34210 | + stream = | |
| 34211 | + object instanceof ReadableStream ? object : ReadableStreamFrom(object) | |
| 34212 | + } | |
| 34213 | + | |
| 34214 | + // 11. If source is a byte sequence, then set action to a | |
| 34215 | + // step that returns source and length to source’s length. | |
| 34216 | + if (typeof source === 'string' || util.isBuffer(source)) { | |
| 34217 | + length = Buffer.byteLength(source) | |
| 34218 | + } | |
| 34219 | + | |
| 34220 | + // 12. If action is non-null, then run these steps in in parallel: | |
| 34221 | + if (action != null) { | |
| 34222 | + // Run action. | |
| 34223 | + let iterator | |
| 34224 | + stream = new ReadableStream({ | |
| 34225 | + async start () { | |
| 34226 | + iterator = action(object)[Symbol.asyncIterator]() | |
| 34227 | + }, | |
| 34228 | + async pull (controller) { | |
| 34229 | + const { value, done } = await iterator.next() | |
| 34230 | + if (done) { | |
| 34231 | + // When running action is done, close stream. | |
| 34232 | + queueMicrotask(() => { | |
| 34233 | + controller.close() | |
| 34234 | + }) | |
| 34235 | + } else { | |
| 34236 | + // Whenever one or more bytes are available and stream is not errored, | |
| 34237 | + // enqueue a Uint8Array wrapping an ArrayBuffer containing the available | |
| 34238 | + // bytes into stream. | |
| 34239 | + if (!isErrored(stream)) { | |
| 34240 | + controller.enqueue(new Uint8Array(value)) | |
| 34241 | + } | |
| 34242 | + } | |
| 34243 | + return controller.desiredSize > 0 | |
| 34244 | + }, | |
| 34245 | + async cancel (reason) { | |
| 34246 | + await iterator.return() | |
| 34247 | + }, | |
| 34248 | + type: undefined | |
| 34249 | + }) | |
| 34250 | + } | |
| 34251 | + | |
| 34252 | + // 13. Let body be a body whose stream is stream, source is source, | |
| 34253 | + // and length is length. | |
| 34254 | + const body = { stream, source, length } | |
| 34255 | + | |
| 34256 | + // 14. Return (body, type). | |
| 34257 | + return [body, type] | |
| 34258 | +} | |
| 34259 | + | |
| 34260 | +// https://fetch.spec.whatwg.org/#bodyinit-safely-extract | |
| 34261 | +function safelyExtractBody (object, keepalive = false) { | |
| 34262 | + if (!ReadableStream) { | |
| 34263 | + // istanbul ignore next | |
| 34264 | + ReadableStream = (__nccwpck_require__(3774).ReadableStream) | |
| 34265 | + } | |
| 34266 | + | |
| 34267 | + // To safely extract a body and a `Content-Type` value from | |
| 34268 | + // a byte sequence or BodyInit object object, run these steps: | |
| 34269 | + | |
| 34270 | + // 1. If object is a ReadableStream object, then: | |
| 34271 | + if (object instanceof ReadableStream) { | |
| 34272 | + // Assert: object is neither disturbed nor locked. | |
| 34273 | + // istanbul ignore next | |
| 34274 | + assert(!util.isDisturbed(object), 'The body has already been consumed.') | |
| 34275 | + // istanbul ignore next | |
| 34276 | + assert(!object.locked, 'The stream is locked.') | |
| 34277 | + } | |
| 34278 | + | |
| 34279 | + // 2. Return the results of extracting object. | |
| 34280 | + return extractBody(object, keepalive) | |
| 34281 | +} | |
| 34282 | + | |
| 34283 | +function cloneBody (body) { | |
| 34284 | + // To clone a body body, run these steps: | |
| 34285 | + | |
| 34286 | + // https://fetch.spec.whatwg.org/#concept-body-clone | |
| 34287 | + | |
| 34288 | + // 1. Let « out1, out2 » be the result of teeing body’s stream. | |
| 34289 | + const [out1, out2] = body.stream.tee() | |
| 34290 | + const out2Clone = structuredClone(out2, { transfer: [out2] }) | |
| 34291 | + // This, for whatever reasons, unrefs out2Clone which allows | |
| 34292 | + // the process to exit by itself. | |
| 34293 | + const [, finalClone] = out2Clone.tee() | |
| 34294 | + | |
| 34295 | + // 2. Set body’s stream to out1. | |
| 34296 | + body.stream = out1 | |
| 34297 | + | |
| 34298 | + // 3. Return a body whose stream is out2 and other members are copied from body. | |
| 34299 | + return { | |
| 34300 | + stream: finalClone, | |
| 34301 | + length: body.length, | |
| 34302 | + source: body.source | |
| 34303 | + } | |
| 34304 | +} | |
| 34305 | + | |
| 34306 | +async function * consumeBody (body) { | |
| 34307 | + if (body) { | |
| 34308 | + if (isUint8Array(body)) { | |
| 34309 | + yield body | |
| 34310 | + } else { | |
| 34311 | + const stream = body.stream | |
| 34312 | + | |
| 34313 | + if (util.isDisturbed(stream)) { | |
| 34314 | + throw new TypeError('The body has already been consumed.') | |
| 34315 | + } | |
| 34316 | + | |
| 34317 | + if (stream.locked) { | |
| 34318 | + throw new TypeError('The stream is locked.') | |
| 34319 | + } | |
| 34320 | + | |
| 34321 | + // Compat. | |
| 34322 | + stream[kBodyUsed] = true | |
| 34323 | + | |
| 34324 | + yield * stream | |
| 34325 | + } | |
| 34326 | + } | |
| 34327 | +} | |
| 34328 | + | |
| 34329 | +function throwIfAborted (state) { | |
| 34330 | + if (state.aborted) { | |
| 34331 | + throw new DOMException('The operation was aborted.', 'AbortError') | |
| 34332 | + } | |
| 34333 | +} | |
| 34334 | + | |
| 34335 | +function bodyMixinMethods (instance) { | |
| 34336 | + const methods = { | |
| 34337 | + blob () { | |
| 34338 | + // The blob() method steps are to return the result of | |
| 34339 | + // running consume body with this and the following step | |
| 34340 | + // given a byte sequence bytes: return a Blob whose | |
| 34341 | + // contents are bytes and whose type attribute is this’s | |
| 34342 | + // MIME type. | |
| 34343 | + return specConsumeBody(this, (bytes) => { | |
| 34344 | + let mimeType = bodyMimeType(this) | |
| 34345 | + | |
| 34346 | + if (mimeType === 'failure') { | |
| 34347 | + mimeType = '' | |
| 34348 | + } else if (mimeType) { | |
| 34349 | + mimeType = serializeAMimeType(mimeType) | |
| 34350 | + } | |
| 34351 | + | |
| 34352 | + // Return a Blob whose contents are bytes and type attribute | |
| 34353 | + // is mimeType. | |
| 34354 | + return new Blob([bytes], { type: mimeType }) | |
| 34355 | + }, instance) | |
| 34356 | + }, | |
| 34357 | + | |
| 34358 | + arrayBuffer () { | |
| 34359 | + // The arrayBuffer() method steps are to return the result | |
| 34360 | + // of running consume body with this and the following step | |
| 34361 | + // given a byte sequence bytes: return a new ArrayBuffer | |
| 34362 | + // whose contents are bytes. | |
| 34363 | + return specConsumeBody(this, (bytes) => { | |
| 34364 | + return new Uint8Array(bytes).buffer | |
| 34365 | + }, instance) | |
| 34366 | + }, | |
| 34367 | + | |
| 34368 | + text () { | |
| 34369 | + // The text() method steps are to return the result of running | |
| 34370 | + // consume body with this and UTF-8 decode. | |
| 34371 | + return specConsumeBody(this, utf8DecodeBytes, instance) | |
| 34372 | + }, | |
| 34373 | + | |
| 34374 | + json () { | |
| 34375 | + // The json() method steps are to return the result of running | |
| 34376 | + // consume body with this and parse JSON from bytes. | |
| 34377 | + return specConsumeBody(this, parseJSONFromBytes, instance) | |
| 34378 | + }, | |
| 34379 | + | |
| 34380 | + async formData () { | |
| 34381 | + webidl.brandCheck(this, instance) | |
| 34382 | + | |
| 34383 | + throwIfAborted(this[kState]) | |
| 34384 | + | |
| 34385 | + const contentType = this.headers.get('Content-Type') | |
| 34386 | + | |
| 34387 | + // If mimeType’s essence is "multipart/form-data", then: | |
| 34388 | + if (/multipart\/form-data/.test(contentType)) { | |
| 34389 | + const headers = {} | |
| 34390 | + for (const [key, value] of this.headers) headers[key.toLowerCase()] = value | |
| 34391 | + | |
| 34392 | + const responseFormData = new FormData() | |
| 34393 | + | |
| 34394 | + let busboy | |
| 34395 | + | |
| 34396 | + try { | |
| 34397 | + busboy = new Busboy({ | |
| 34398 | + headers, | |
| 34399 | + preservePath: true | |
| 34400 | + }) | |
| 34401 | + } catch (err) { | |
| 34402 | + throw new DOMException(`${err}`, 'AbortError') | |
| 34403 | + } | |
| 34404 | + | |
| 34405 | + busboy.on('field', (name, value) => { | |
| 34406 | + responseFormData.append(name, value) | |
| 34407 | + }) | |
| 34408 | + busboy.on('file', (name, value, filename, encoding, mimeType) => { | |
| 34409 | + const chunks = [] | |
| 34410 | + | |
| 34411 | + if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { | |
| 34412 | + let base64chunk = '' | |
| 34413 | + | |
| 34414 | + value.on('data', (chunk) => { | |
| 34415 | + base64chunk += chunk.toString().replace(/[\r\n]/gm, '') | |
| 34416 | + | |
| 34417 | + const end = base64chunk.length - base64chunk.length % 4 | |
| 34418 | + chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) | |
| 34419 | + | |
| 34420 | + base64chunk = base64chunk.slice(end) | |
| 34421 | + }) | |
| 34422 | + value.on('end', () => { | |
| 34423 | + chunks.push(Buffer.from(base64chunk, 'base64')) | |
| 34424 | + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) | |
| 34425 | + }) | |
| 34426 | + } else { | |
| 34427 | + value.on('data', (chunk) => { | |
| 34428 | + chunks.push(chunk) | |
| 34429 | + }) | |
| 34430 | + value.on('end', () => { | |
| 34431 | + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) | |
| 34432 | + }) | |
| 34433 | + } | |
| 34434 | + }) | |
| 34435 | + | |
| 34436 | + const busboyResolve = new Promise((resolve, reject) => { | |
| 34437 | + busboy.on('finish', resolve) | |
| 34438 | + busboy.on('error', (err) => reject(new TypeError(err))) | |
| 34439 | + }) | |
| 34440 | + | |
| 34441 | + if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) | |
| 34442 | + busboy.end() | |
| 34443 | + await busboyResolve | |
| 34444 | + | |
| 34445 | + return responseFormData | |
| 34446 | + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { | |
| 34447 | + // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: | |
| 34448 | + | |
| 34449 | + // 1. Let entries be the result of parsing bytes. | |
| 34450 | + let entries | |
| 34451 | + try { | |
| 34452 | + let text = '' | |
| 34453 | + // application/x-www-form-urlencoded parser will keep the BOM. | |
| 34454 | + // https://url.spec.whatwg.org/#concept-urlencoded-parser | |
| 34455 | + // Note that streaming decoder is stateful and cannot be reused | |
| 34456 | + const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) | |
| 34457 | + | |
| 34458 | + for await (const chunk of consumeBody(this[kState].body)) { | |
| 34459 | + if (!isUint8Array(chunk)) { | |
| 34460 | + throw new TypeError('Expected Uint8Array chunk') | |
| 34461 | + } | |
| 34462 | + text += streamingDecoder.decode(chunk, { stream: true }) | |
| 34463 | + } | |
| 34464 | + text += streamingDecoder.decode() | |
| 34465 | + entries = new URLSearchParams(text) | |
| 34466 | + } catch (err) { | |
| 34467 | + // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. | |
| 34468 | + // 2. If entries is failure, then throw a TypeError. | |
| 34469 | + throw Object.assign(new TypeError(), { cause: err }) | |
| 34470 | + } | |
| 34471 | + | |
| 34472 | + // 3. Return a new FormData object whose entries are entries. | |
| 34473 | + const formData = new FormData() | |
| 34474 | + for (const [name, value] of entries) { | |
| 34475 | + formData.append(name, value) | |
| 34476 | + } | |
| 34477 | + return formData | |
| 34478 | + } else { | |
| 34479 | + // Wait a tick before checking if the request has been aborted. | |
| 34480 | + // Otherwise, a TypeError can be thrown when an AbortError should. | |
| 34481 | + await Promise.resolve() | |
| 34482 | + | |
| 34483 | + throwIfAborted(this[kState]) | |
| 34484 | + | |
| 34485 | + // Otherwise, throw a TypeError. | |
| 34486 | + throw webidl.errors.exception({ | |
| 34487 | + header: `${instance.name}.formData`, | |
| 34488 | + message: 'Could not parse content as FormData.' | |
| 34489 | + }) | |
| 34490 | + } | |
| 34491 | + } | |
| 34492 | + } | |
| 34493 | + | |
| 34494 | + return methods | |
| 34495 | +} | |
| 34496 | + | |
| 34497 | +function mixinBody (prototype) { | |
| 34498 | + Object.assign(prototype.prototype, bodyMixinMethods(prototype)) | |
| 34499 | +} | |
| 34500 | + | |
| 34501 | +/** | |
| 34502 | + * @see https://fetch.spec.whatwg.org/#concept-body-consume-body | |
| 34503 | + * @param {Response|Request} object | |
| 34504 | + * @param {(value: unknown) => unknown} convertBytesToJSValue | |
| 34505 | + * @param {Response|Request} instance | |
| 34506 | + */ | |
| 34507 | +async function specConsumeBody (object, convertBytesToJSValue, instance) { | |
| 34508 | + webidl.brandCheck(object, instance) | |
| 34509 | + | |
| 34510 | + throwIfAborted(object[kState]) | |
| 34511 | + | |
| 34512 | + // 1. If object is unusable, then return a promise rejected | |
| 34513 | + // with a TypeError. | |
| 34514 | + if (bodyUnusable(object[kState].body)) { | |
| 34515 | + throw new TypeError('Body is unusable') | |
| 34516 | + } | |
| 34517 | + | |
| 34518 | + // 2. Let promise be a new promise. | |
| 34519 | + const promise = createDeferredPromise() | |
| 34520 | + | |
| 34521 | + // 3. Let errorSteps given error be to reject promise with error. | |
| 34522 | + const errorSteps = (error) => promise.reject(error) | |
| 34523 | + | |
| 34524 | + // 4. Let successSteps given a byte sequence data be to resolve | |
| 34525 | + // promise with the result of running convertBytesToJSValue | |
| 34526 | + // with data. If that threw an exception, then run errorSteps | |
| 34527 | + // with that exception. | |
| 34528 | + const successSteps = (data) => { | |
| 34529 | + try { | |
| 34530 | + promise.resolve(convertBytesToJSValue(data)) | |
| 34531 | + } catch (e) { | |
| 34532 | + errorSteps(e) | |
| 34533 | + } | |
| 34534 | + } | |
| 34535 | + | |
| 34536 | + // 5. If object’s body is null, then run successSteps with an | |
| 34537 | + // empty byte sequence. | |
| 34538 | + if (object[kState].body == null) { | |
| 34539 | + successSteps(new Uint8Array()) | |
| 34540 | + return promise.promise | |
| 34541 | + } | |
| 34542 | + | |
| 34543 | + // 6. Otherwise, fully read object’s body given successSteps, | |
| 34544 | + // errorSteps, and object’s relevant global object. | |
| 34545 | + await fullyReadBody(object[kState].body, successSteps, errorSteps) | |
| 34546 | + | |
| 34547 | + // 7. Return promise. | |
| 34548 | + return promise.promise | |
| 34549 | +} | |
| 34550 | + | |
| 34551 | +// https://fetch.spec.whatwg.org/#body-unusable | |
| 34552 | +function bodyUnusable (body) { | |
| 34553 | + // An object including the Body interface mixin is | |
| 34554 | + // said to be unusable if its body is non-null and | |
| 34555 | + // its body’s stream is disturbed or locked. | |
| 34556 | + return body != null && (body.stream.locked || util.isDisturbed(body.stream)) | |
| 34557 | +} | |
| 34558 | + | |
| 34559 | +/** | |
| 34560 | + * @see https://encoding.spec.whatwg.org/#utf-8-decode | |
| 34561 | + * @param {Buffer} buffer | |
| 34562 | + */ | |
| 34563 | +function utf8DecodeBytes (buffer) { | |
| 34564 | + if (buffer.length === 0) { | |
| 34565 | + return '' | |
| 34566 | + } | |
| 34567 | + | |
| 34568 | + // 1. Let buffer be the result of peeking three bytes from | |
| 34569 | + // ioQueue, converted to a byte sequence. | |
| 34570 | + | |
| 34571 | + // 2. If buffer is 0xEF 0xBB 0xBF, then read three | |
| 34572 | + // bytes from ioQueue. (Do nothing with those bytes.) | |
| 34573 | + if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { | |
| 34574 | + buffer = buffer.subarray(3) | |
| 34575 | + } | |
| 34576 | + | |
| 34577 | + // 3. Process a queue with an instance of UTF-8’s | |
| 34578 | + // decoder, ioQueue, output, and "replacement". | |
| 34579 | + const output = textDecoder.decode(buffer) | |
| 34580 | + | |
| 34581 | + // 4. Return output. | |
| 34582 | + return output | |
| 34583 | +} | |
| 34584 | + | |
| 34585 | +/** | |
| 34586 | + * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value | |
| 34587 | + * @param {Uint8Array} bytes | |
| 34588 | + */ | |
| 34589 | +function parseJSONFromBytes (bytes) { | |
| 34590 | + return JSON.parse(utf8DecodeBytes(bytes)) | |
| 34591 | +} | |
| 34592 | + | |
| 34593 | +/** | |
| 34594 | + * @see https://fetch.spec.whatwg.org/#concept-body-mime-type | |
| 34595 | + * @param {import('./response').Response|import('./request').Request} object | |
| 34596 | + */ | |
| 34597 | +function bodyMimeType (object) { | |
| 34598 | + const { headersList } = object[kState] | |
| 34599 | + const contentType = headersList.get('content-type') | |
| 34600 | + | |
| 34601 | + if (contentType === null) { | |
| 34602 | + return 'failure' | |
| 34603 | + } | |
| 34604 | + | |
| 34605 | + return parseMIMEType(contentType) | |
| 34606 | +} | |
| 34607 | + | |
| 34608 | +module.exports = { | |
| 34609 | + extractBody, | |
| 34610 | + safelyExtractBody, | |
| 34611 | + cloneBody, | |
| 34612 | + mixinBody | |
| 34613 | +} | |
| 34614 | + | |
| 34615 | + | |
| 34616 | +/***/ }), | |
| 34617 | + | |
| 34618 | +/***/ 7326: | |
| 34619 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 34620 | + | |
| 34621 | +"use strict"; | |
| 34622 | + | |
| 34623 | + | |
| 34624 | +const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(8167) | |
| 34625 | + | |
| 34626 | +const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] | |
| 34627 | +const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) | |
| 34628 | + | |
| 34629 | +const nullBodyStatus = [101, 204, 205, 304] | |
| 34630 | + | |
| 34631 | +const redirectStatus = [301, 302, 303, 307, 308] | |
| 34632 | +const redirectStatusSet = new Set(redirectStatus) | |
| 34633 | + | |
| 34634 | +// https://fetch.spec.whatwg.org/#block-bad-port | |
| 34635 | +const badPorts = [ | |
| 34636 | + '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', | |
| 34637 | + '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', | |
| 34638 | + '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', | |
| 34639 | + '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', | |
| 34640 | + '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', | |
| 34641 | + '10080' | |
| 34642 | +] | |
| 34643 | + | |
| 34644 | +const badPortsSet = new Set(badPorts) | |
| 34645 | + | |
| 34646 | +// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies | |
| 34647 | +const referrerPolicy = [ | |
| 34648 | + '', | |
| 34649 | + 'no-referrer', | |
| 34650 | + 'no-referrer-when-downgrade', | |
| 34651 | + 'same-origin', | |
| 34652 | + 'origin', | |
| 34653 | + 'strict-origin', | |
| 34654 | + 'origin-when-cross-origin', | |
| 34655 | + 'strict-origin-when-cross-origin', | |
| 34656 | + 'unsafe-url' | |
| 34657 | +] | |
| 34658 | +const referrerPolicySet = new Set(referrerPolicy) | |
| 34659 | + | |
| 34660 | +const requestRedirect = ['follow', 'manual', 'error'] | |
| 34661 | + | |
| 34662 | +const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] | |
| 34663 | +const safeMethodsSet = new Set(safeMethods) | |
| 34664 | + | |
| 34665 | +const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] | |
| 34666 | + | |
| 34667 | +const requestCredentials = ['omit', 'same-origin', 'include'] | |
| 34668 | + | |
| 34669 | +const requestCache = [ | |
| 34670 | + 'default', | |
| 34671 | + 'no-store', | |
| 34672 | + 'reload', | |
| 34673 | + 'no-cache', | |
| 34674 | + 'force-cache', | |
| 34675 | + 'only-if-cached' | |
| 34676 | +] | |
| 34677 | + | |
| 34678 | +// https://fetch.spec.whatwg.org/#request-body-header-name | |
| 34679 | +const requestBodyHeader = [ | |
| 34680 | + 'content-encoding', | |
| 34681 | + 'content-language', | |
| 34682 | + 'content-location', | |
| 34683 | + 'content-type', | |
| 34684 | + // See https://github.com/nodejs/undici/issues/2021 | |
| 34685 | + // 'Content-Length' is a forbidden header name, which is typically | |
| 34686 | + // removed in the Headers implementation. However, undici doesn't | |
| 34687 | + // filter out headers, so we add it here. | |
| 34688 | + 'content-length' | |
| 34689 | +] | |
| 34690 | + | |
| 34691 | +// https://fetch.spec.whatwg.org/#enumdef-requestduplex | |
| 34692 | +const requestDuplex = [ | |
| 34693 | + 'half' | |
| 34694 | +] | |
| 34695 | + | |
| 34696 | +// http://fetch.spec.whatwg.org/#forbidden-method | |
| 34697 | +const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] | |
| 34698 | +const forbiddenMethodsSet = new Set(forbiddenMethods) | |
| 34699 | + | |
| 34700 | +const subresource = [ | |
| 34701 | + 'audio', | |
| 34702 | + 'audioworklet', | |
| 34703 | + 'font', | |
| 34704 | + 'image', | |
| 34705 | + 'manifest', | |
| 34706 | + 'paintworklet', | |
| 34707 | + 'script', | |
| 34708 | + 'style', | |
| 34709 | + 'track', | |
| 34710 | + 'video', | |
| 34711 | + 'xslt', | |
| 34712 | + '' | |
| 34713 | +] | |
| 34714 | +const subresourceSet = new Set(subresource) | |
| 34715 | + | |
| 34716 | +/** @type {globalThis['DOMException']} */ | |
| 34717 | +const DOMException = globalThis.DOMException ?? (() => { | |
| 34718 | + // DOMException was only made a global in Node v17.0.0, | |
| 34719 | + // but fetch supports >= v16.8. | |
| 34720 | + try { | |
| 34721 | + atob('~') | |
| 34722 | + } catch (err) { | |
| 34723 | + return Object.getPrototypeOf(err).constructor | |
| 34724 | + } | |
| 34725 | +})() | |
| 34726 | + | |
| 34727 | +let channel | |
| 34728 | + | |
| 34729 | +/** @type {globalThis['structuredClone']} */ | |
| 34730 | +const structuredClone = | |
| 34731 | + globalThis.structuredClone ?? | |
| 34732 | + // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js | |
| 34733 | + // structuredClone was added in v17.0.0, but fetch supports v16.8 | |
| 34734 | + function structuredClone (value, options = undefined) { | |
| 34735 | + if (arguments.length === 0) { | |
| 34736 | + throw new TypeError('missing argument') | |
| 34737 | + } | |
| 34738 | + | |
| 34739 | + if (!channel) { | |
| 34740 | + channel = new MessageChannel() | |
| 34741 | + } | |
| 34742 | + channel.port1.unref() | |
| 34743 | + channel.port2.unref() | |
| 34744 | + channel.port1.postMessage(value, options?.transfer) | |
| 34745 | + return receiveMessageOnPort(channel.port2).message | |
| 34746 | + } | |
| 34747 | + | |
| 34748 | +module.exports = { | |
| 34749 | + DOMException, | |
| 34750 | + structuredClone, | |
| 34751 | + subresource, | |
| 34752 | + forbiddenMethods, | |
| 34753 | + requestBodyHeader, | |
| 34754 | + referrerPolicy, | |
| 34755 | + requestRedirect, | |
| 34756 | + requestMode, | |
| 34757 | + requestCredentials, | |
| 34758 | + requestCache, | |
| 34759 | + redirectStatus, | |
| 34760 | + corsSafeListedMethods, | |
| 34761 | + nullBodyStatus, | |
| 34762 | + safeMethods, | |
| 34763 | + badPorts, | |
| 34764 | + requestDuplex, | |
| 34765 | + subresourceSet, | |
| 34766 | + badPortsSet, | |
| 34767 | + redirectStatusSet, | |
| 34768 | + corsSafeListedMethodsSet, | |
| 34769 | + safeMethodsSet, | |
| 34770 | + forbiddenMethodsSet, | |
| 34771 | + referrerPolicySet | |
| 34772 | +} | |
| 34773 | + | |
| 34774 | + | |
| 34775 | +/***/ }), | |
| 34776 | + | |
| 34777 | +/***/ 4322: | |
| 34778 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 34779 | + | |
| 34780 | +const assert = __nccwpck_require__(2613) | |
| 34781 | +const { atob } = __nccwpck_require__(181) | |
| 34782 | +const { isomorphicDecode } = __nccwpck_require__(5523) | |
| 34783 | + | |
| 34784 | +const encoder = new TextEncoder() | |
| 34785 | + | |
| 34786 | +/** | |
| 34787 | + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point | |
| 34788 | + */ | |
| 34789 | +const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ | |
| 34790 | +const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line | |
| 34791 | +/** | |
| 34792 | + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point | |
| 34793 | + */ | |
| 34794 | +const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line | |
| 34795 | + | |
| 34796 | +// https://fetch.spec.whatwg.org/#data-url-processor | |
| 34797 | +/** @param {URL} dataURL */ | |
| 34798 | +function dataURLProcessor (dataURL) { | |
| 34799 | + // 1. Assert: dataURL’s scheme is "data". | |
| 34800 | + assert(dataURL.protocol === 'data:') | |
| 34801 | + | |
| 34802 | + // 2. Let input be the result of running the URL | |
| 34803 | + // serializer on dataURL with exclude fragment | |
| 34804 | + // set to true. | |
| 34805 | + let input = URLSerializer(dataURL, true) | |
| 34806 | + | |
| 34807 | + // 3. Remove the leading "data:" string from input. | |
| 34808 | + input = input.slice(5) | |
| 34809 | + | |
| 34810 | + // 4. Let position point at the start of input. | |
| 34811 | + const position = { position: 0 } | |
| 34812 | + | |
| 34813 | + // 5. Let mimeType be the result of collecting a | |
| 34814 | + // sequence of code points that are not equal | |
| 34815 | + // to U+002C (,), given position. | |
| 34816 | + let mimeType = collectASequenceOfCodePointsFast( | |
| 34817 | + ',', | |
| 34818 | + input, | |
| 34819 | + position | |
| 34820 | + ) | |
| 34821 | + | |
| 34822 | + // 6. Strip leading and trailing ASCII whitespace | |
| 34823 | + // from mimeType. | |
| 34824 | + // Undici implementation note: we need to store the | |
| 34825 | + // length because if the mimetype has spaces removed, | |
| 34826 | + // the wrong amount will be sliced from the input in | |
| 34827 | + // step #9 | |
| 34828 | + const mimeTypeLength = mimeType.length | |
| 34829 | + mimeType = removeASCIIWhitespace(mimeType, true, true) | |
| 34830 | + | |
| 34831 | + // 7. If position is past the end of input, then | |
| 34832 | + // return failure | |
| 34833 | + if (position.position >= input.length) { | |
| 34834 | + return 'failure' | |
| 34835 | + } | |
| 34836 | + | |
| 34837 | + // 8. Advance position by 1. | |
| 34838 | + position.position++ | |
| 34839 | + | |
| 34840 | + // 9. Let encodedBody be the remainder of input. | |
| 34841 | + const encodedBody = input.slice(mimeTypeLength + 1) | |
| 34842 | + | |
| 34843 | + // 10. Let body be the percent-decoding of encodedBody. | |
| 34844 | + let body = stringPercentDecode(encodedBody) | |
| 34845 | + | |
| 34846 | + // 11. If mimeType ends with U+003B (;), followed by | |
| 34847 | + // zero or more U+0020 SPACE, followed by an ASCII | |
| 34848 | + // case-insensitive match for "base64", then: | |
| 34849 | + if (/;(\u0020){0,}base64$/i.test(mimeType)) { | |
| 34850 | + // 1. Let stringBody be the isomorphic decode of body. | |
| 34851 | + const stringBody = isomorphicDecode(body) | |
| 34852 | + | |
| 34853 | + // 2. Set body to the forgiving-base64 decode of | |
| 34854 | + // stringBody. | |
| 34855 | + body = forgivingBase64(stringBody) | |
| 34856 | + | |
| 34857 | + // 3. If body is failure, then return failure. | |
| 34858 | + if (body === 'failure') { | |
| 34859 | + return 'failure' | |
| 34860 | + } | |
| 34861 | + | |
| 34862 | + // 4. Remove the last 6 code points from mimeType. | |
| 34863 | + mimeType = mimeType.slice(0, -6) | |
| 34864 | + | |
| 34865 | + // 5. Remove trailing U+0020 SPACE code points from mimeType, | |
| 34866 | + // if any. | |
| 34867 | + mimeType = mimeType.replace(/(\u0020)+$/, '') | |
| 34868 | + | |
| 34869 | + // 6. Remove the last U+003B (;) code point from mimeType. | |
| 34870 | + mimeType = mimeType.slice(0, -1) | |
| 34871 | + } | |
| 34872 | + | |
| 34873 | + // 12. If mimeType starts with U+003B (;), then prepend | |
| 34874 | + // "text/plain" to mimeType. | |
| 34875 | + if (mimeType.startsWith(';')) { | |
| 34876 | + mimeType = 'text/plain' + mimeType | |
| 34877 | + } | |
| 34878 | + | |
| 34879 | + // 13. Let mimeTypeRecord be the result of parsing | |
| 34880 | + // mimeType. | |
| 34881 | + let mimeTypeRecord = parseMIMEType(mimeType) | |
| 34882 | + | |
| 34883 | + // 14. If mimeTypeRecord is failure, then set | |
| 34884 | + // mimeTypeRecord to text/plain;charset=US-ASCII. | |
| 34885 | + if (mimeTypeRecord === 'failure') { | |
| 34886 | + mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') | |
| 34887 | + } | |
| 34888 | + | |
| 34889 | + // 15. Return a new data: URL struct whose MIME | |
| 34890 | + // type is mimeTypeRecord and body is body. | |
| 34891 | + // https://fetch.spec.whatwg.org/#data-url-struct | |
| 34892 | + return { mimeType: mimeTypeRecord, body } | |
| 34893 | +} | |
| 34894 | + | |
| 34895 | +// https://url.spec.whatwg.org/#concept-url-serializer | |
| 34896 | +/** | |
| 34897 | + * @param {URL} url | |
| 34898 | + * @param {boolean} excludeFragment | |
| 34899 | + */ | |
| 34900 | +function URLSerializer (url, excludeFragment = false) { | |
| 34901 | + if (!excludeFragment) { | |
| 34902 | + return url.href | |
| 34903 | + } | |
| 34904 | + | |
| 34905 | + const href = url.href | |
| 34906 | + const hashLength = url.hash.length | |
| 34907 | + | |
| 34908 | + return hashLength === 0 ? href : href.substring(0, href.length - hashLength) | |
| 34909 | +} | |
| 34910 | + | |
| 34911 | +// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points | |
| 34912 | +/** | |
| 34913 | + * @param {(char: string) => boolean} condition | |
| 34914 | + * @param {string} input | |
| 34915 | + * @param {{ position: number }} position | |
| 34916 | + */ | |
| 34917 | +function collectASequenceOfCodePoints (condition, input, position) { | |
| 34918 | + // 1. Let result be the empty string. | |
| 34919 | + let result = '' | |
| 34920 | + | |
| 34921 | + // 2. While position doesn’t point past the end of input and the | |
| 34922 | + // code point at position within input meets the condition condition: | |
| 34923 | + while (position.position < input.length && condition(input[position.position])) { | |
| 34924 | + // 1. Append that code point to the end of result. | |
| 34925 | + result += input[position.position] | |
| 34926 | + | |
| 34927 | + // 2. Advance position by 1. | |
| 34928 | + position.position++ | |
| 34929 | + } | |
| 34930 | + | |
| 34931 | + // 3. Return result. | |
| 34932 | + return result | |
| 34933 | +} | |
| 34934 | + | |
| 34935 | +/** | |
| 34936 | + * A faster collectASequenceOfCodePoints that only works when comparing a single character. | |
| 34937 | + * @param {string} char | |
| 34938 | + * @param {string} input | |
| 34939 | + * @param {{ position: number }} position | |
| 34940 | + */ | |
| 34941 | +function collectASequenceOfCodePointsFast (char, input, position) { | |
| 34942 | + const idx = input.indexOf(char, position.position) | |
| 34943 | + const start = position.position | |
| 34944 | + | |
| 34945 | + if (idx === -1) { | |
| 34946 | + position.position = input.length | |
| 34947 | + return input.slice(start) | |
| 34948 | + } | |
| 34949 | + | |
| 34950 | + position.position = idx | |
| 34951 | + return input.slice(start, position.position) | |
| 34952 | +} | |
| 34953 | + | |
| 34954 | +// https://url.spec.whatwg.org/#string-percent-decode | |
| 34955 | +/** @param {string} input */ | |
| 34956 | +function stringPercentDecode (input) { | |
| 34957 | + // 1. Let bytes be the UTF-8 encoding of input. | |
| 34958 | + const bytes = encoder.encode(input) | |
| 34959 | + | |
| 34960 | + // 2. Return the percent-decoding of bytes. | |
| 34961 | + return percentDecode(bytes) | |
| 34962 | +} | |
| 34963 | + | |
| 34964 | +// https://url.spec.whatwg.org/#percent-decode | |
| 34965 | +/** @param {Uint8Array} input */ | |
| 34966 | +function percentDecode (input) { | |
| 34967 | + // 1. Let output be an empty byte sequence. | |
| 34968 | + /** @type {number[]} */ | |
| 34969 | + const output = [] | |
| 34970 | + | |
| 34971 | + // 2. For each byte byte in input: | |
| 34972 | + for (let i = 0; i < input.length; i++) { | |
| 34973 | + const byte = input[i] | |
| 34974 | + | |
| 34975 | + // 1. If byte is not 0x25 (%), then append byte to output. | |
| 34976 | + if (byte !== 0x25) { | |
| 34977 | + output.push(byte) | |
| 34978 | + | |
| 34979 | + // 2. Otherwise, if byte is 0x25 (%) and the next two bytes | |
| 34980 | + // after byte in input are not in the ranges | |
| 34981 | + // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), | |
| 34982 | + // and 0x61 (a) to 0x66 (f), all inclusive, append byte | |
| 34983 | + // to output. | |
| 34984 | + } else if ( | |
| 34985 | + byte === 0x25 && | |
| 34986 | + !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) | |
| 34987 | + ) { | |
| 34988 | + output.push(0x25) | |
| 34989 | + | |
| 34990 | + // 3. Otherwise: | |
| 34991 | + } else { | |
| 34992 | + // 1. Let bytePoint be the two bytes after byte in input, | |
| 34993 | + // decoded, and then interpreted as hexadecimal number. | |
| 34994 | + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) | |
| 34995 | + const bytePoint = Number.parseInt(nextTwoBytes, 16) | |
| 34996 | + | |
| 34997 | + // 2. Append a byte whose value is bytePoint to output. | |
| 34998 | + output.push(bytePoint) | |
| 34999 | + | |
| 35000 | + // 3. Skip the next two bytes in input. | |
| 35001 | + i += 2 | |
| 35002 | + } | |
| 35003 | + } | |
| 35004 | + | |
| 35005 | + // 3. Return output. | |
| 35006 | + return Uint8Array.from(output) | |
| 35007 | +} | |
| 35008 | + | |
| 35009 | +// https://mimesniff.spec.whatwg.org/#parse-a-mime-type | |
| 35010 | +/** @param {string} input */ | |
| 35011 | +function parseMIMEType (input) { | |
| 35012 | + // 1. Remove any leading and trailing HTTP whitespace | |
| 35013 | + // from input. | |
| 35014 | + input = removeHTTPWhitespace(input, true, true) | |
| 35015 | + | |
| 35016 | + // 2. Let position be a position variable for input, | |
| 35017 | + // initially pointing at the start of input. | |
| 35018 | + const position = { position: 0 } | |
| 35019 | + | |
| 35020 | + // 3. Let type be the result of collecting a sequence | |
| 35021 | + // of code points that are not U+002F (/) from | |
| 35022 | + // input, given position. | |
| 35023 | + const type = collectASequenceOfCodePointsFast( | |
| 35024 | + '/', | |
| 35025 | + input, | |
| 35026 | + position | |
| 35027 | + ) | |
| 35028 | + | |
| 35029 | + // 4. If type is the empty string or does not solely | |
| 35030 | + // contain HTTP token code points, then return failure. | |
| 35031 | + // https://mimesniff.spec.whatwg.org/#http-token-code-point | |
| 35032 | + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { | |
| 35033 | + return 'failure' | |
| 35034 | + } | |
| 35035 | + | |
| 35036 | + // 5. If position is past the end of input, then return | |
| 35037 | + // failure | |
| 35038 | + if (position.position > input.length) { | |
| 35039 | + return 'failure' | |
| 35040 | + } | |
| 35041 | + | |
| 35042 | + // 6. Advance position by 1. (This skips past U+002F (/).) | |
| 35043 | + position.position++ | |
| 35044 | + | |
| 35045 | + // 7. Let subtype be the result of collecting a sequence of | |
| 35046 | + // code points that are not U+003B (;) from input, given | |
| 35047 | + // position. | |
| 35048 | + let subtype = collectASequenceOfCodePointsFast( | |
| 35049 | + ';', | |
| 35050 | + input, | |
| 35051 | + position | |
| 35052 | + ) | |
| 35053 | + | |
| 35054 | + // 8. Remove any trailing HTTP whitespace from subtype. | |
| 35055 | + subtype = removeHTTPWhitespace(subtype, false, true) | |
| 35056 | + | |
| 35057 | + // 9. If subtype is the empty string or does not solely | |
| 35058 | + // contain HTTP token code points, then return failure. | |
| 35059 | + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { | |
| 35060 | + return 'failure' | |
| 35061 | + } | |
| 35062 | + | |
| 35063 | + const typeLowercase = type.toLowerCase() | |
| 35064 | + const subtypeLowercase = subtype.toLowerCase() | |
| 35065 | + | |
| 35066 | + // 10. Let mimeType be a new MIME type record whose type | |
| 35067 | + // is type, in ASCII lowercase, and subtype is subtype, | |
| 35068 | + // in ASCII lowercase. | |
| 35069 | + // https://mimesniff.spec.whatwg.org/#mime-type | |
| 35070 | + const mimeType = { | |
| 35071 | + type: typeLowercase, | |
| 35072 | + subtype: subtypeLowercase, | |
| 35073 | + /** @type {Map<string, string>} */ | |
| 35074 | + parameters: new Map(), | |
| 35075 | + // https://mimesniff.spec.whatwg.org/#mime-type-essence | |
| 35076 | + essence: `${typeLowercase}/${subtypeLowercase}` | |
| 35077 | + } | |
| 35078 | + | |
| 35079 | + // 11. While position is not past the end of input: | |
| 35080 | + while (position.position < input.length) { | |
| 35081 | + // 1. Advance position by 1. (This skips past U+003B (;).) | |
| 35082 | + position.position++ | |
| 35083 | + | |
| 35084 | + // 2. Collect a sequence of code points that are HTTP | |
| 35085 | + // whitespace from input given position. | |
| 35086 | + collectASequenceOfCodePoints( | |
| 35087 | + // https://fetch.spec.whatwg.org/#http-whitespace | |
| 35088 | + char => HTTP_WHITESPACE_REGEX.test(char), | |
| 35089 | + input, | |
| 35090 | + position | |
| 35091 | + ) | |
| 35092 | + | |
| 35093 | + // 3. Let parameterName be the result of collecting a | |
| 35094 | + // sequence of code points that are not U+003B (;) | |
| 35095 | + // or U+003D (=) from input, given position. | |
| 35096 | + let parameterName = collectASequenceOfCodePoints( | |
| 35097 | + (char) => char !== ';' && char !== '=', | |
| 35098 | + input, | |
| 35099 | + position | |
| 35100 | + ) | |
| 35101 | + | |
| 35102 | + // 4. Set parameterName to parameterName, in ASCII | |
| 35103 | + // lowercase. | |
| 35104 | + parameterName = parameterName.toLowerCase() | |
| 35105 | + | |
| 35106 | + // 5. If position is not past the end of input, then: | |
| 35107 | + if (position.position < input.length) { | |
| 35108 | + // 1. If the code point at position within input is | |
| 35109 | + // U+003B (;), then continue. | |
| 35110 | + if (input[position.position] === ';') { | |
| 35111 | + continue | |
| 35112 | + } | |
| 35113 | + | |
| 35114 | + // 2. Advance position by 1. (This skips past U+003D (=).) | |
| 35115 | + position.position++ | |
| 35116 | + } | |
| 35117 | + | |
| 35118 | + // 6. If position is past the end of input, then break. | |
| 35119 | + if (position.position > input.length) { | |
| 35120 | + break | |
| 35121 | + } | |
| 35122 | + | |
| 35123 | + // 7. Let parameterValue be null. | |
| 35124 | + let parameterValue = null | |
| 35125 | + | |
| 35126 | + // 8. If the code point at position within input is | |
| 35127 | + // U+0022 ("), then: | |
| 35128 | + if (input[position.position] === '"') { | |
| 35129 | + // 1. Set parameterValue to the result of collecting | |
| 35130 | + // an HTTP quoted string from input, given position | |
| 35131 | + // and the extract-value flag. | |
| 35132 | + parameterValue = collectAnHTTPQuotedString(input, position, true) | |
| 35133 | + | |
| 35134 | + // 2. Collect a sequence of code points that are not | |
| 35135 | + // U+003B (;) from input, given position. | |
| 35136 | + collectASequenceOfCodePointsFast( | |
| 35137 | + ';', | |
| 35138 | + input, | |
| 35139 | + position | |
| 35140 | + ) | |
| 35141 | + | |
| 35142 | + // 9. Otherwise: | |
| 35143 | + } else { | |
| 35144 | + // 1. Set parameterValue to the result of collecting | |
| 35145 | + // a sequence of code points that are not U+003B (;) | |
| 35146 | + // from input, given position. | |
| 35147 | + parameterValue = collectASequenceOfCodePointsFast( | |
| 35148 | + ';', | |
| 35149 | + input, | |
| 35150 | + position | |
| 35151 | + ) | |
| 35152 | + | |
| 35153 | + // 2. Remove any trailing HTTP whitespace from parameterValue. | |
| 35154 | + parameterValue = removeHTTPWhitespace(parameterValue, false, true) | |
| 35155 | + | |
| 35156 | + // 3. If parameterValue is the empty string, then continue. | |
| 35157 | + if (parameterValue.length === 0) { | |
| 35158 | + continue | |
| 35159 | + } | |
| 35160 | + } | |
| 35161 | + | |
| 35162 | + // 10. If all of the following are true | |
| 35163 | + // - parameterName is not the empty string | |
| 35164 | + // - parameterName solely contains HTTP token code points | |
| 35165 | + // - parameterValue solely contains HTTP quoted-string token code points | |
| 35166 | + // - mimeType’s parameters[parameterName] does not exist | |
| 35167 | + // then set mimeType’s parameters[parameterName] to parameterValue. | |
| 35168 | + if ( | |
| 35169 | + parameterName.length !== 0 && | |
| 35170 | + HTTP_TOKEN_CODEPOINTS.test(parameterName) && | |
| 35171 | + (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && | |
| 35172 | + !mimeType.parameters.has(parameterName) | |
| 35173 | + ) { | |
| 35174 | + mimeType.parameters.set(parameterName, parameterValue) | |
| 35175 | + } | |
| 35176 | + } | |
| 35177 | + | |
| 35178 | + // 12. Return mimeType. | |
| 35179 | + return mimeType | |
| 35180 | +} | |
| 35181 | + | |
| 35182 | +// https://infra.spec.whatwg.org/#forgiving-base64-decode | |
| 35183 | +/** @param {string} data */ | |
| 35184 | +function forgivingBase64 (data) { | |
| 35185 | + // 1. Remove all ASCII whitespace from data. | |
| 35186 | + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line | |
| 35187 | + | |
| 35188 | + // 2. If data’s code point length divides by 4 leaving | |
| 35189 | + // no remainder, then: | |
| 35190 | + if (data.length % 4 === 0) { | |
| 35191 | + // 1. If data ends with one or two U+003D (=) code points, | |
| 35192 | + // then remove them from data. | |
| 35193 | + data = data.replace(/=?=$/, '') | |
| 35194 | + } | |
| 35195 | + | |
| 35196 | + // 3. If data’s code point length divides by 4 leaving | |
| 35197 | + // a remainder of 1, then return failure. | |
| 35198 | + if (data.length % 4 === 1) { | |
| 35199 | + return 'failure' | |
| 35200 | + } | |
| 35201 | + | |
| 35202 | + // 4. If data contains a code point that is not one of | |
| 35203 | + // U+002B (+) | |
| 35204 | + // U+002F (/) | |
| 35205 | + // ASCII alphanumeric | |
| 35206 | + // then return failure. | |
| 35207 | + if (/[^+/0-9A-Za-z]/.test(data)) { | |
| 35208 | + return 'failure' | |
| 35209 | + } | |
| 35210 | + | |
| 35211 | + const binary = atob(data) | |
| 35212 | + const bytes = new Uint8Array(binary.length) | |
| 35213 | + | |
| 35214 | + for (let byte = 0; byte < binary.length; byte++) { | |
| 35215 | + bytes[byte] = binary.charCodeAt(byte) | |
| 35216 | + } | |
| 35217 | + | |
| 35218 | + return bytes | |
| 35219 | +} | |
| 35220 | + | |
| 35221 | +// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string | |
| 35222 | +// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string | |
| 35223 | +/** | |
| 35224 | + * @param {string} input | |
| 35225 | + * @param {{ position: number }} position | |
| 35226 | + * @param {boolean?} extractValue | |
| 35227 | + */ | |
| 35228 | +function collectAnHTTPQuotedString (input, position, extractValue) { | |
| 35229 | + // 1. Let positionStart be position. | |
| 35230 | + const positionStart = position.position | |
| 35231 | + | |
| 35232 | + // 2. Let value be the empty string. | |
| 35233 | + let value = '' | |
| 35234 | + | |
| 35235 | + // 3. Assert: the code point at position within input | |
| 35236 | + // is U+0022 ("). | |
| 35237 | + assert(input[position.position] === '"') | |
| 35238 | + | |
| 35239 | + // 4. Advance position by 1. | |
| 35240 | + position.position++ | |
| 35241 | + | |
| 35242 | + // 5. While true: | |
| 35243 | + while (true) { | |
| 35244 | + // 1. Append the result of collecting a sequence of code points | |
| 35245 | + // that are not U+0022 (") or U+005C (\) from input, given | |
| 35246 | + // position, to value. | |
| 35247 | + value += collectASequenceOfCodePoints( | |
| 35248 | + (char) => char !== '"' && char !== '\\', | |
| 35249 | + input, | |
| 35250 | + position | |
| 35251 | + ) | |
| 35252 | + | |
| 35253 | + // 2. If position is past the end of input, then break. | |
| 35254 | + if (position.position >= input.length) { | |
| 35255 | + break | |
| 35256 | + } | |
| 35257 | + | |
| 35258 | + // 3. Let quoteOrBackslash be the code point at position within | |
| 35259 | + // input. | |
| 35260 | + const quoteOrBackslash = input[position.position] | |
| 35261 | + | |
| 35262 | + // 4. Advance position by 1. | |
| 35263 | + position.position++ | |
| 35264 | + | |
| 35265 | + // 5. If quoteOrBackslash is U+005C (\), then: | |
| 35266 | + if (quoteOrBackslash === '\\') { | |
| 35267 | + // 1. If position is past the end of input, then append | |
| 35268 | + // U+005C (\) to value and break. | |
| 35269 | + if (position.position >= input.length) { | |
| 35270 | + value += '\\' | |
| 35271 | + break | |
| 35272 | + } | |
| 35273 | + | |
| 35274 | + // 2. Append the code point at position within input to value. | |
| 35275 | + value += input[position.position] | |
| 35276 | + | |
| 35277 | + // 3. Advance position by 1. | |
| 35278 | + position.position++ | |
| 35279 | + | |
| 35280 | + // 6. Otherwise: | |
| 35281 | + } else { | |
| 35282 | + // 1. Assert: quoteOrBackslash is U+0022 ("). | |
| 35283 | + assert(quoteOrBackslash === '"') | |
| 35284 | + | |
| 35285 | + // 2. Break. | |
| 35286 | + break | |
| 35287 | + } | |
| 35288 | + } | |
| 35289 | + | |
| 35290 | + // 6. If the extract-value flag is set, then return value. | |
| 35291 | + if (extractValue) { | |
| 35292 | + return value | |
| 35293 | + } | |
| 35294 | + | |
| 35295 | + // 7. Return the code points from positionStart to position, | |
| 35296 | + // inclusive, within input. | |
| 35297 | + return input.slice(positionStart, position.position) | |
| 35298 | +} | |
| 35299 | + | |
| 35300 | +/** | |
| 35301 | + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type | |
| 35302 | + */ | |
| 35303 | +function serializeAMimeType (mimeType) { | |
| 35304 | + assert(mimeType !== 'failure') | |
| 35305 | + const { parameters, essence } = mimeType | |
| 35306 | + | |
| 35307 | + // 1. Let serialization be the concatenation of mimeType’s | |
| 35308 | + // type, U+002F (/), and mimeType’s subtype. | |
| 35309 | + let serialization = essence | |
| 35310 | + | |
| 35311 | + // 2. For each name → value of mimeType’s parameters: | |
| 35312 | + for (let [name, value] of parameters.entries()) { | |
| 35313 | + // 1. Append U+003B (;) to serialization. | |
| 35314 | + serialization += ';' | |
| 35315 | + | |
| 35316 | + // 2. Append name to serialization. | |
| 35317 | + serialization += name | |
| 35318 | + | |
| 35319 | + // 3. Append U+003D (=) to serialization. | |
| 35320 | + serialization += '=' | |
| 35321 | + | |
| 35322 | + // 4. If value does not solely contain HTTP token code | |
| 35323 | + // points or value is the empty string, then: | |
| 35324 | + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { | |
| 35325 | + // 1. Precede each occurence of U+0022 (") or | |
| 35326 | + // U+005C (\) in value with U+005C (\). | |
| 35327 | + value = value.replace(/(\\|")/g, '\\$1') | |
| 35328 | + | |
| 35329 | + // 2. Prepend U+0022 (") to value. | |
| 35330 | + value = '"' + value | |
| 35331 | + | |
| 35332 | + // 3. Append U+0022 (") to value. | |
| 35333 | + value += '"' | |
| 35334 | + } | |
| 35335 | + | |
| 35336 | + // 5. Append value to serialization. | |
| 35337 | + serialization += value | |
| 35338 | + } | |
| 35339 | + | |
| 35340 | + // 3. Return serialization. | |
| 35341 | + return serialization | |
| 35342 | +} | |
| 35343 | + | |
| 35344 | +/** | |
| 35345 | + * @see https://fetch.spec.whatwg.org/#http-whitespace | |
| 35346 | + * @param {string} char | |
| 35347 | + */ | |
| 35348 | +function isHTTPWhiteSpace (char) { | |
| 35349 | + return char === '\r' || char === '\n' || char === '\t' || char === ' ' | |
| 35350 | +} | |
| 35351 | + | |
| 35352 | +/** | |
| 35353 | + * @see https://fetch.spec.whatwg.org/#http-whitespace | |
| 35354 | + * @param {string} str | |
| 35355 | + */ | |
| 35356 | +function removeHTTPWhitespace (str, leading = true, trailing = true) { | |
| 35357 | + let lead = 0 | |
| 35358 | + let trail = str.length - 1 | |
| 35359 | + | |
| 35360 | + if (leading) { | |
| 35361 | + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); | |
| 35362 | + } | |
| 35363 | + | |
| 35364 | + if (trailing) { | |
| 35365 | + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); | |
| 35366 | + } | |
| 35367 | + | |
| 35368 | + return str.slice(lead, trail + 1) | |
| 35369 | +} | |
| 35370 | + | |
| 35371 | +/** | |
| 35372 | + * @see https://infra.spec.whatwg.org/#ascii-whitespace | |
| 35373 | + * @param {string} char | |
| 35374 | + */ | |
| 35375 | +function isASCIIWhitespace (char) { | |
| 35376 | + return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' | |
| 35377 | +} | |
| 35378 | + | |
| 35379 | +/** | |
| 35380 | + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace | |
| 35381 | + */ | |
| 35382 | +function removeASCIIWhitespace (str, leading = true, trailing = true) { | |
| 35383 | + let lead = 0 | |
| 35384 | + let trail = str.length - 1 | |
| 35385 | + | |
| 35386 | + if (leading) { | |
| 35387 | + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); | |
| 35388 | + } | |
| 35389 | + | |
| 35390 | + if (trailing) { | |
| 35391 | + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); | |
| 35392 | + } | |
| 35393 | + | |
| 35394 | + return str.slice(lead, trail + 1) | |
| 35395 | +} | |
| 35396 | + | |
| 35397 | +module.exports = { | |
| 35398 | + dataURLProcessor, | |
| 35399 | + URLSerializer, | |
| 35400 | + collectASequenceOfCodePoints, | |
| 35401 | + collectASequenceOfCodePointsFast, | |
| 35402 | + stringPercentDecode, | |
| 35403 | + parseMIMEType, | |
| 35404 | + collectAnHTTPQuotedString, | |
| 35405 | + serializeAMimeType | |
| 35406 | +} | |
| 35407 | + | |
| 35408 | + | |
| 35409 | +/***/ }), | |
| 35410 | + | |
| 35411 | +/***/ 3041: | |
| 35412 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 35413 | + | |
| 35414 | +"use strict"; | |
| 35415 | + | |
| 35416 | + | |
| 35417 | +const { Blob, File: NativeFile } = __nccwpck_require__(181) | |
| 35418 | +const { types } = __nccwpck_require__(9023) | |
| 35419 | +const { kState } = __nccwpck_require__(9710) | |
| 35420 | +const { isBlobLike } = __nccwpck_require__(5523) | |
| 35421 | +const { webidl } = __nccwpck_require__(4222) | |
| 35422 | +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) | |
| 35423 | +const { kEnumerableProperty } = __nccwpck_require__(3440) | |
| 35424 | +const encoder = new TextEncoder() | |
| 35425 | + | |
| 35426 | +class File extends Blob { | |
| 35427 | + constructor (fileBits, fileName, options = {}) { | |
| 35428 | + // The File constructor is invoked with two or three parameters, depending | |
| 35429 | + // on whether the optional dictionary parameter is used. When the File() | |
| 35430 | + // constructor is invoked, user agents must run the following steps: | |
| 35431 | + webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) | |
| 35432 | + | |
| 35433 | + fileBits = webidl.converters['sequence<BlobPart>'](fileBits) | |
| 35434 | + fileName = webidl.converters.USVString(fileName) | |
| 35435 | + options = webidl.converters.FilePropertyBag(options) | |
| 35436 | + | |
| 35437 | + // 1. Let bytes be the result of processing blob parts given fileBits and | |
| 35438 | + // options. | |
| 35439 | + // Note: Blob handles this for us | |
| 35440 | + | |
| 35441 | + // 2. Let n be the fileName argument to the constructor. | |
| 35442 | + const n = fileName | |
| 35443 | + | |
| 35444 | + // 3. Process FilePropertyBag dictionary argument by running the following | |
| 35445 | + // substeps: | |
| 35446 | + | |
| 35447 | + // 1. If the type member is provided and is not the empty string, let t | |
| 35448 | + // be set to the type dictionary member. If t contains any characters | |
| 35449 | + // outside the range U+0020 to U+007E, then set t to the empty string | |
| 35450 | + // and return from these substeps. | |
| 35451 | + // 2. Convert every character in t to ASCII lowercase. | |
| 35452 | + let t = options.type | |
| 35453 | + let d | |
| 35454 | + | |
| 35455 | + // eslint-disable-next-line no-labels | |
| 35456 | + substep: { | |
| 35457 | + if (t) { | |
| 35458 | + t = parseMIMEType(t) | |
| 35459 | + | |
| 35460 | + if (t === 'failure') { | |
| 35461 | + t = '' | |
| 35462 | + // eslint-disable-next-line no-labels | |
| 35463 | + break substep | |
| 35464 | + } | |
| 35465 | + | |
| 35466 | + t = serializeAMimeType(t).toLowerCase() | |
| 35467 | + } | |
| 35468 | + | |
| 35469 | + // 3. If the lastModified member is provided, let d be set to the | |
| 35470 | + // lastModified dictionary member. If it is not provided, set d to the | |
| 35471 | + // current date and time represented as the number of milliseconds since | |
| 35472 | + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). | |
| 35473 | + d = options.lastModified | |
| 35474 | + } | |
| 35475 | + | |
| 35476 | + // 4. Return a new File object F such that: | |
| 35477 | + // F refers to the bytes byte sequence. | |
| 35478 | + // F.size is set to the number of total bytes in bytes. | |
| 35479 | + // F.name is set to n. | |
| 35480 | + // F.type is set to t. | |
| 35481 | + // F.lastModified is set to d. | |
| 35482 | + | |
| 35483 | + super(processBlobParts(fileBits, options), { type: t }) | |
| 35484 | + this[kState] = { | |
| 35485 | + name: n, | |
| 35486 | + lastModified: d, | |
| 35487 | + type: t | |
| 35488 | + } | |
| 35489 | + } | |
| 35490 | + | |
| 35491 | + get name () { | |
| 35492 | + webidl.brandCheck(this, File) | |
| 35493 | + | |
| 35494 | + return this[kState].name | |
| 35495 | + } | |
| 35496 | + | |
| 35497 | + get lastModified () { | |
| 35498 | + webidl.brandCheck(this, File) | |
| 35499 | + | |
| 35500 | + return this[kState].lastModified | |
| 35501 | + } | |
| 35502 | + | |
| 35503 | + get type () { | |
| 35504 | + webidl.brandCheck(this, File) | |
| 35505 | + | |
| 35506 | + return this[kState].type | |
| 35507 | + } | |
| 35508 | +} | |
| 35509 | + | |
| 35510 | +class FileLike { | |
| 35511 | + constructor (blobLike, fileName, options = {}) { | |
| 35512 | + // TODO: argument idl type check | |
| 35513 | + | |
| 35514 | + // The File constructor is invoked with two or three parameters, depending | |
| 35515 | + // on whether the optional dictionary parameter is used. When the File() | |
| 35516 | + // constructor is invoked, user agents must run the following steps: | |
| 35517 | + | |
| 35518 | + // 1. Let bytes be the result of processing blob parts given fileBits and | |
| 35519 | + // options. | |
| 35520 | + | |
| 35521 | + // 2. Let n be the fileName argument to the constructor. | |
| 35522 | + const n = fileName | |
| 35523 | + | |
| 35524 | + // 3. Process FilePropertyBag dictionary argument by running the following | |
| 35525 | + // substeps: | |
| 35526 | + | |
| 35527 | + // 1. If the type member is provided and is not the empty string, let t | |
| 35528 | + // be set to the type dictionary member. If t contains any characters | |
| 35529 | + // outside the range U+0020 to U+007E, then set t to the empty string | |
| 35530 | + // and return from these substeps. | |
| 35531 | + // TODO | |
| 35532 | + const t = options.type | |
| 35533 | + | |
| 35534 | + // 2. Convert every character in t to ASCII lowercase. | |
| 35535 | + // TODO | |
| 35536 | + | |
| 35537 | + // 3. If the lastModified member is provided, let d be set to the | |
| 35538 | + // lastModified dictionary member. If it is not provided, set d to the | |
| 35539 | + // current date and time represented as the number of milliseconds since | |
| 35540 | + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). | |
| 35541 | + const d = options.lastModified ?? Date.now() | |
| 35542 | + | |
| 35543 | + // 4. Return a new File object F such that: | |
| 35544 | + // F refers to the bytes byte sequence. | |
| 35545 | + // F.size is set to the number of total bytes in bytes. | |
| 35546 | + // F.name is set to n. | |
| 35547 | + // F.type is set to t. | |
| 35548 | + // F.lastModified is set to d. | |
| 35549 | + | |
| 35550 | + this[kState] = { | |
| 35551 | + blobLike, | |
| 35552 | + name: n, | |
| 35553 | + type: t, | |
| 35554 | + lastModified: d | |
| 35555 | + } | |
| 35556 | + } | |
| 35557 | + | |
| 35558 | + stream (...args) { | |
| 35559 | + webidl.brandCheck(this, FileLike) | |
| 35560 | + | |
| 35561 | + return this[kState].blobLike.stream(...args) | |
| 35562 | + } | |
| 35563 | + | |
| 35564 | + arrayBuffer (...args) { | |
| 35565 | + webidl.brandCheck(this, FileLike) | |
| 35566 | + | |
| 35567 | + return this[kState].blobLike.arrayBuffer(...args) | |
| 35568 | + } | |
| 35569 | + | |
| 35570 | + slice (...args) { | |
| 35571 | + webidl.brandCheck(this, FileLike) | |
| 35572 | + | |
| 35573 | + return this[kState].blobLike.slice(...args) | |
| 35574 | + } | |
| 35575 | + | |
| 35576 | + text (...args) { | |
| 35577 | + webidl.brandCheck(this, FileLike) | |
| 35578 | + | |
| 35579 | + return this[kState].blobLike.text(...args) | |
| 35580 | + } | |
| 35581 | + | |
| 35582 | + get size () { | |
| 35583 | + webidl.brandCheck(this, FileLike) | |
| 35584 | + | |
| 35585 | + return this[kState].blobLike.size | |
| 35586 | + } | |
| 35587 | + | |
| 35588 | + get type () { | |
| 35589 | + webidl.brandCheck(this, FileLike) | |
| 35590 | + | |
| 35591 | + return this[kState].blobLike.type | |
| 35592 | + } | |
| 35593 | + | |
| 35594 | + get name () { | |
| 35595 | + webidl.brandCheck(this, FileLike) | |
| 35596 | + | |
| 35597 | + return this[kState].name | |
| 35598 | + } | |
| 35599 | + | |
| 35600 | + get lastModified () { | |
| 35601 | + webidl.brandCheck(this, FileLike) | |
| 35602 | + | |
| 35603 | + return this[kState].lastModified | |
| 35604 | + } | |
| 35605 | + | |
| 35606 | + get [Symbol.toStringTag] () { | |
| 35607 | + return 'File' | |
| 35608 | + } | |
| 35609 | +} | |
| 35610 | + | |
| 35611 | +Object.defineProperties(File.prototype, { | |
| 35612 | + [Symbol.toStringTag]: { | |
| 35613 | + value: 'File', | |
| 35614 | + configurable: true | |
| 35615 | + }, | |
| 35616 | + name: kEnumerableProperty, | |
| 35617 | + lastModified: kEnumerableProperty | |
| 35618 | +}) | |
| 35619 | + | |
| 35620 | +webidl.converters.Blob = webidl.interfaceConverter(Blob) | |
| 35621 | + | |
| 35622 | +webidl.converters.BlobPart = function (V, opts) { | |
| 35623 | + if (webidl.util.Type(V) === 'Object') { | |
| 35624 | + if (isBlobLike(V)) { | |
| 35625 | + return webidl.converters.Blob(V, { strict: false }) | |
| 35626 | + } | |
| 35627 | + | |
| 35628 | + if ( | |
| 35629 | + ArrayBuffer.isView(V) || | |
| 35630 | + types.isAnyArrayBuffer(V) | |
| 35631 | + ) { | |
| 35632 | + return webidl.converters.BufferSource(V, opts) | |
| 35633 | + } | |
| 35634 | + } | |
| 35635 | + | |
| 35636 | + return webidl.converters.USVString(V, opts) | |
| 35637 | +} | |
| 35638 | + | |
| 35639 | +webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter( | |
| 35640 | + webidl.converters.BlobPart | |
| 35641 | +) | |
| 35642 | + | |
| 35643 | +// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag | |
| 35644 | +webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ | |
| 35645 | + { | |
| 35646 | + key: 'lastModified', | |
| 35647 | + converter: webidl.converters['long long'], | |
| 35648 | + get defaultValue () { | |
| 35649 | + return Date.now() | |
| 35650 | + } | |
| 35651 | + }, | |
| 35652 | + { | |
| 35653 | + key: 'type', | |
| 35654 | + converter: webidl.converters.DOMString, | |
| 35655 | + defaultValue: '' | |
| 35656 | + }, | |
| 35657 | + { | |
| 35658 | + key: 'endings', | |
| 35659 | + converter: (value) => { | |
| 35660 | + value = webidl.converters.DOMString(value) | |
| 35661 | + value = value.toLowerCase() | |
| 35662 | + | |
| 35663 | + if (value !== 'native') { | |
| 35664 | + value = 'transparent' | |
| 35665 | + } | |
| 35666 | + | |
| 35667 | + return value | |
| 35668 | + }, | |
| 35669 | + defaultValue: 'transparent' | |
| 35670 | + } | |
| 35671 | +]) | |
| 35672 | + | |
| 35673 | +/** | |
| 35674 | + * @see https://www.w3.org/TR/FileAPI/#process-blob-parts | |
| 35675 | + * @param {(NodeJS.TypedArray|Blob|string)[]} parts | |
| 35676 | + * @param {{ type: string, endings: string }} options | |
| 35677 | + */ | |
| 35678 | +function processBlobParts (parts, options) { | |
| 35679 | + // 1. Let bytes be an empty sequence of bytes. | |
| 35680 | + /** @type {NodeJS.TypedArray[]} */ | |
| 35681 | + const bytes = [] | |
| 35682 | + | |
| 35683 | + // 2. For each element in parts: | |
| 35684 | + for (const element of parts) { | |
| 35685 | + // 1. If element is a USVString, run the following substeps: | |
| 35686 | + if (typeof element === 'string') { | |
| 35687 | + // 1. Let s be element. | |
| 35688 | + let s = element | |
| 35689 | + | |
| 35690 | + // 2. If the endings member of options is "native", set s | |
| 35691 | + // to the result of converting line endings to native | |
| 35692 | + // of element. | |
| 35693 | + if (options.endings === 'native') { | |
| 35694 | + s = convertLineEndingsNative(s) | |
| 35695 | + } | |
| 35696 | + | |
| 35697 | + // 3. Append the result of UTF-8 encoding s to bytes. | |
| 35698 | + bytes.push(encoder.encode(s)) | |
| 35699 | + } else if ( | |
| 35700 | + types.isAnyArrayBuffer(element) || | |
| 35701 | + types.isTypedArray(element) | |
| 35702 | + ) { | |
| 35703 | + // 2. If element is a BufferSource, get a copy of the | |
| 35704 | + // bytes held by the buffer source, and append those | |
| 35705 | + // bytes to bytes. | |
| 35706 | + if (!element.buffer) { // ArrayBuffer | |
| 35707 | + bytes.push(new Uint8Array(element)) | |
| 35708 | + } else { | |
| 35709 | + bytes.push( | |
| 35710 | + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) | |
| 35711 | + ) | |
| 35712 | + } | |
| 35713 | + } else if (isBlobLike(element)) { | |
| 35714 | + // 3. If element is a Blob, append the bytes it represents | |
| 35715 | + // to bytes. | |
| 35716 | + bytes.push(element) | |
| 35717 | + } | |
| 35718 | + } | |
| 35719 | + | |
| 35720 | + // 3. Return bytes. | |
| 35721 | + return bytes | |
| 35722 | +} | |
| 35723 | + | |
| 35724 | +/** | |
| 35725 | + * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native | |
| 35726 | + * @param {string} s | |
| 35727 | + */ | |
| 35728 | +function convertLineEndingsNative (s) { | |
| 35729 | + // 1. Let native line ending be be the code point U+000A LF. | |
| 35730 | + let nativeLineEnding = '\n' | |
| 35731 | + | |
| 35732 | + // 2. If the underlying platform’s conventions are to | |
| 35733 | + // represent newlines as a carriage return and line feed | |
| 35734 | + // sequence, set native line ending to the code point | |
| 35735 | + // U+000D CR followed by the code point U+000A LF. | |
| 35736 | + if (process.platform === 'win32') { | |
| 35737 | + nativeLineEnding = '\r\n' | |
| 35738 | + } | |
| 35739 | + | |
| 35740 | + return s.replace(/\r?\n/g, nativeLineEnding) | |
| 35741 | +} | |
| 35742 | + | |
| 35743 | +// If this function is moved to ./util.js, some tools (such as | |
| 35744 | +// rollup) will warn about circular dependencies. See: | |
| 35745 | +// https://github.com/nodejs/undici/issues/1629 | |
| 35746 | +function isFileLike (object) { | |
| 35747 | + return ( | |
| 35748 | + (NativeFile && object instanceof NativeFile) || | |
| 35749 | + object instanceof File || ( | |
| 35750 | + object && | |
| 35751 | + (typeof object.stream === 'function' || | |
| 35752 | + typeof object.arrayBuffer === 'function') && | |
| 35753 | + object[Symbol.toStringTag] === 'File' | |
| 35754 | + ) | |
| 35755 | + ) | |
| 35756 | +} | |
| 35757 | + | |
| 35758 | +module.exports = { File, FileLike, isFileLike } | |
| 35759 | + | |
| 35760 | + | |
| 35761 | +/***/ }), | |
| 35762 | + | |
| 35763 | +/***/ 3073: | |
| 35764 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 35765 | + | |
| 35766 | +"use strict"; | |
| 35767 | + | |
| 35768 | + | |
| 35769 | +const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(5523) | |
| 35770 | +const { kState } = __nccwpck_require__(9710) | |
| 35771 | +const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(3041) | |
| 35772 | +const { webidl } = __nccwpck_require__(4222) | |
| 35773 | +const { Blob, File: NativeFile } = __nccwpck_require__(181) | |
| 35774 | + | |
| 35775 | +/** @type {globalThis['File']} */ | |
| 35776 | +const File = NativeFile ?? UndiciFile | |
| 35777 | + | |
| 35778 | +// https://xhr.spec.whatwg.org/#formdata | |
| 35779 | +class FormData { | |
| 35780 | + constructor (form) { | |
| 35781 | + if (form !== undefined) { | |
| 35782 | + throw webidl.errors.conversionFailed({ | |
| 35783 | + prefix: 'FormData constructor', | |
| 35784 | + argument: 'Argument 1', | |
| 35785 | + types: ['undefined'] | |
| 35786 | + }) | |
| 35787 | + } | |
| 35788 | + | |
| 35789 | + this[kState] = [] | |
| 35790 | + } | |
| 35791 | + | |
| 35792 | + append (name, value, filename = undefined) { | |
| 35793 | + webidl.brandCheck(this, FormData) | |
| 35794 | + | |
| 35795 | + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) | |
| 35796 | + | |
| 35797 | + if (arguments.length === 3 && !isBlobLike(value)) { | |
| 35798 | + throw new TypeError( | |
| 35799 | + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" | |
| 35800 | + ) | |
| 35801 | + } | |
| 35802 | + | |
| 35803 | + // 1. Let value be value if given; otherwise blobValue. | |
| 35804 | + | |
| 35805 | + name = webidl.converters.USVString(name) | |
| 35806 | + value = isBlobLike(value) | |
| 35807 | + ? webidl.converters.Blob(value, { strict: false }) | |
| 35808 | + : webidl.converters.USVString(value) | |
| 35809 | + filename = arguments.length === 3 | |
| 35810 | + ? webidl.converters.USVString(filename) | |
| 35811 | + : undefined | |
| 35812 | + | |
| 35813 | + // 2. Let entry be the result of creating an entry with | |
| 35814 | + // name, value, and filename if given. | |
| 35815 | + const entry = makeEntry(name, value, filename) | |
| 35816 | + | |
| 35817 | + // 3. Append entry to this’s entry list. | |
| 35818 | + this[kState].push(entry) | |
| 35819 | + } | |
| 35820 | + | |
| 35821 | + delete (name) { | |
| 35822 | + webidl.brandCheck(this, FormData) | |
| 35823 | + | |
| 35824 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) | |
| 35825 | + | |
| 35826 | + name = webidl.converters.USVString(name) | |
| 35827 | + | |
| 35828 | + // The delete(name) method steps are to remove all entries whose name | |
| 35829 | + // is name from this’s entry list. | |
| 35830 | + this[kState] = this[kState].filter(entry => entry.name !== name) | |
| 35831 | + } | |
| 35832 | + | |
| 35833 | + get (name) { | |
| 35834 | + webidl.brandCheck(this, FormData) | |
| 35835 | + | |
| 35836 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) | |
| 35837 | + | |
| 35838 | + name = webidl.converters.USVString(name) | |
| 35839 | + | |
| 35840 | + // 1. If there is no entry whose name is name in this’s entry list, | |
| 35841 | + // then return null. | |
| 35842 | + const idx = this[kState].findIndex((entry) => entry.name === name) | |
| 35843 | + if (idx === -1) { | |
| 35844 | + return null | |
| 35845 | + } | |
| 35846 | + | |
| 35847 | + // 2. Return the value of the first entry whose name is name from | |
| 35848 | + // this’s entry list. | |
| 35849 | + return this[kState][idx].value | |
| 35850 | + } | |
| 35851 | + | |
| 35852 | + getAll (name) { | |
| 35853 | + webidl.brandCheck(this, FormData) | |
| 35854 | + | |
| 35855 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) | |
| 35856 | + | |
| 35857 | + name = webidl.converters.USVString(name) | |
| 35858 | + | |
| 35859 | + // 1. If there is no entry whose name is name in this’s entry list, | |
| 35860 | + // then return the empty list. | |
| 35861 | + // 2. Return the values of all entries whose name is name, in order, | |
| 35862 | + // from this’s entry list. | |
| 35863 | + return this[kState] | |
| 35864 | + .filter((entry) => entry.name === name) | |
| 35865 | + .map((entry) => entry.value) | |
| 35866 | + } | |
| 35867 | + | |
| 35868 | + has (name) { | |
| 35869 | + webidl.brandCheck(this, FormData) | |
| 35870 | + | |
| 35871 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) | |
| 35872 | + | |
| 35873 | + name = webidl.converters.USVString(name) | |
| 35874 | + | |
| 35875 | + // The has(name) method steps are to return true if there is an entry | |
| 35876 | + // whose name is name in this’s entry list; otherwise false. | |
| 35877 | + return this[kState].findIndex((entry) => entry.name === name) !== -1 | |
| 35878 | + } | |
| 35879 | + | |
| 35880 | + set (name, value, filename = undefined) { | |
| 35881 | + webidl.brandCheck(this, FormData) | |
| 35882 | + | |
| 35883 | + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) | |
| 35884 | + | |
| 35885 | + if (arguments.length === 3 && !isBlobLike(value)) { | |
| 35886 | + throw new TypeError( | |
| 35887 | + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" | |
| 35888 | + ) | |
| 35889 | + } | |
| 35890 | + | |
| 35891 | + // The set(name, value) and set(name, blobValue, filename) method steps | |
| 35892 | + // are: | |
| 35893 | + | |
| 35894 | + // 1. Let value be value if given; otherwise blobValue. | |
| 35895 | + | |
| 35896 | + name = webidl.converters.USVString(name) | |
| 35897 | + value = isBlobLike(value) | |
| 35898 | + ? webidl.converters.Blob(value, { strict: false }) | |
| 35899 | + : webidl.converters.USVString(value) | |
| 35900 | + filename = arguments.length === 3 | |
| 35901 | + ? toUSVString(filename) | |
| 35902 | + : undefined | |
| 35903 | + | |
| 35904 | + // 2. Let entry be the result of creating an entry with name, value, and | |
| 35905 | + // filename if given. | |
| 35906 | + const entry = makeEntry(name, value, filename) | |
| 35907 | + | |
| 35908 | + // 3. If there are entries in this’s entry list whose name is name, then | |
| 35909 | + // replace the first such entry with entry and remove the others. | |
| 35910 | + const idx = this[kState].findIndex((entry) => entry.name === name) | |
| 35911 | + if (idx !== -1) { | |
| 35912 | + this[kState] = [ | |
| 35913 | + ...this[kState].slice(0, idx), | |
| 35914 | + entry, | |
| 35915 | + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) | |
| 35916 | + ] | |
| 35917 | + } else { | |
| 35918 | + // 4. Otherwise, append entry to this’s entry list. | |
| 35919 | + this[kState].push(entry) | |
| 35920 | + } | |
| 35921 | + } | |
| 35922 | + | |
| 35923 | + entries () { | |
| 35924 | + webidl.brandCheck(this, FormData) | |
| 35925 | + | |
| 35926 | + return makeIterator( | |
| 35927 | + () => this[kState].map(pair => [pair.name, pair.value]), | |
| 35928 | + 'FormData', | |
| 35929 | + 'key+value' | |
| 35930 | + ) | |
| 35931 | + } | |
| 35932 | + | |
| 35933 | + keys () { | |
| 35934 | + webidl.brandCheck(this, FormData) | |
| 35935 | + | |
| 35936 | + return makeIterator( | |
| 35937 | + () => this[kState].map(pair => [pair.name, pair.value]), | |
| 35938 | + 'FormData', | |
| 35939 | + 'key' | |
| 35940 | + ) | |
| 35941 | + } | |
| 35942 | + | |
| 35943 | + values () { | |
| 35944 | + webidl.brandCheck(this, FormData) | |
| 35945 | + | |
| 35946 | + return makeIterator( | |
| 35947 | + () => this[kState].map(pair => [pair.name, pair.value]), | |
| 35948 | + 'FormData', | |
| 35949 | + 'value' | |
| 35950 | + ) | |
| 35951 | + } | |
| 35952 | + | |
| 35953 | + /** | |
| 35954 | + * @param {(value: string, key: string, self: FormData) => void} callbackFn | |
| 35955 | + * @param {unknown} thisArg | |
| 35956 | + */ | |
| 35957 | + forEach (callbackFn, thisArg = globalThis) { | |
| 35958 | + webidl.brandCheck(this, FormData) | |
| 35959 | + | |
| 35960 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) | |
| 35961 | + | |
| 35962 | + if (typeof callbackFn !== 'function') { | |
| 35963 | + throw new TypeError( | |
| 35964 | + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." | |
| 35965 | + ) | |
| 35966 | + } | |
| 35967 | + | |
| 35968 | + for (const [key, value] of this) { | |
| 35969 | + callbackFn.apply(thisArg, [value, key, this]) | |
| 35970 | + } | |
| 35971 | + } | |
| 35972 | +} | |
| 35973 | + | |
| 35974 | +FormData.prototype[Symbol.iterator] = FormData.prototype.entries | |
| 35975 | + | |
| 35976 | +Object.defineProperties(FormData.prototype, { | |
| 35977 | + [Symbol.toStringTag]: { | |
| 35978 | + value: 'FormData', | |
| 35979 | + configurable: true | |
| 35980 | + } | |
| 35981 | +}) | |
| 35982 | + | |
| 35983 | +/** | |
| 35984 | + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry | |
| 35985 | + * @param {string} name | |
| 35986 | + * @param {string|Blob} value | |
| 35987 | + * @param {?string} filename | |
| 35988 | + * @returns | |
| 35989 | + */ | |
| 35990 | +function makeEntry (name, value, filename) { | |
| 35991 | + // 1. Set name to the result of converting name into a scalar value string. | |
| 35992 | + // "To convert a string into a scalar value string, replace any surrogates | |
| 35993 | + // with U+FFFD." | |
| 35994 | + // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end | |
| 35995 | + name = Buffer.from(name).toString('utf8') | |
| 35996 | + | |
| 35997 | + // 2. If value is a string, then set value to the result of converting | |
| 35998 | + // value into a scalar value string. | |
| 35999 | + if (typeof value === 'string') { | |
| 36000 | + value = Buffer.from(value).toString('utf8') | |
| 36001 | + } else { | |
| 36002 | + // 3. Otherwise: | |
| 36003 | + | |
| 36004 | + // 1. If value is not a File object, then set value to a new File object, | |
| 36005 | + // representing the same bytes, whose name attribute value is "blob" | |
| 36006 | + if (!isFileLike(value)) { | |
| 36007 | + value = value instanceof Blob | |
| 36008 | + ? new File([value], 'blob', { type: value.type }) | |
| 36009 | + : new FileLike(value, 'blob', { type: value.type }) | |
| 36010 | + } | |
| 36011 | + | |
| 36012 | + // 2. If filename is given, then set value to a new File object, | |
| 36013 | + // representing the same bytes, whose name attribute is filename. | |
| 36014 | + if (filename !== undefined) { | |
| 36015 | + /** @type {FilePropertyBag} */ | |
| 36016 | + const options = { | |
| 36017 | + type: value.type, | |
| 36018 | + lastModified: value.lastModified | |
| 36019 | + } | |
| 36020 | + | |
| 36021 | + value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile | |
| 36022 | + ? new File([value], filename, options) | |
| 36023 | + : new FileLike(value, filename, options) | |
| 36024 | + } | |
| 36025 | + } | |
| 36026 | + | |
| 36027 | + // 4. Return an entry whose name is name and whose value is value. | |
| 36028 | + return { name, value } | |
| 36029 | +} | |
| 36030 | + | |
| 36031 | +module.exports = { FormData } | |
| 36032 | + | |
| 36033 | + | |
| 36034 | +/***/ }), | |
| 36035 | + | |
| 36036 | +/***/ 5628: | |
| 36037 | +/***/ ((module) => { | |
| 36038 | + | |
| 36039 | +"use strict"; | |
| 36040 | + | |
| 36041 | + | |
| 36042 | +// In case of breaking changes, increase the version | |
| 36043 | +// number to avoid conflicts. | |
| 36044 | +const globalOrigin = Symbol.for('undici.globalOrigin.1') | |
| 36045 | + | |
| 36046 | +function getGlobalOrigin () { | |
| 36047 | + return globalThis[globalOrigin] | |
| 36048 | +} | |
| 36049 | + | |
| 36050 | +function setGlobalOrigin (newOrigin) { | |
| 36051 | + if (newOrigin === undefined) { | |
| 36052 | + Object.defineProperty(globalThis, globalOrigin, { | |
| 36053 | + value: undefined, | |
| 36054 | + writable: true, | |
| 36055 | + enumerable: false, | |
| 36056 | + configurable: false | |
| 36057 | + }) | |
| 36058 | + | |
| 36059 | + return | |
| 36060 | + } | |
| 36061 | + | |
| 36062 | + const parsedURL = new URL(newOrigin) | |
| 36063 | + | |
| 36064 | + if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { | |
| 36065 | + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) | |
| 36066 | + } | |
| 36067 | + | |
| 36068 | + Object.defineProperty(globalThis, globalOrigin, { | |
| 36069 | + value: parsedURL, | |
| 36070 | + writable: true, | |
| 36071 | + enumerable: false, | |
| 36072 | + configurable: false | |
| 36073 | + }) | |
| 36074 | +} | |
| 36075 | + | |
| 36076 | +module.exports = { | |
| 36077 | + getGlobalOrigin, | |
| 36078 | + setGlobalOrigin | |
| 36079 | +} | |
| 36080 | + | |
| 36081 | + | |
| 36082 | +/***/ }), | |
| 36083 | + | |
| 36084 | +/***/ 6349: | |
| 36085 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 36086 | + | |
| 36087 | +"use strict"; | |
| 36088 | +// https://github.com/Ethan-Arrowood/undici-fetch | |
| 36089 | + | |
| 36090 | + | |
| 36091 | + | |
| 36092 | +const { kHeadersList, kConstruct } = __nccwpck_require__(6443) | |
| 36093 | +const { kGuard } = __nccwpck_require__(9710) | |
| 36094 | +const { kEnumerableProperty } = __nccwpck_require__(3440) | |
| 36095 | +const { | |
| 36096 | + makeIterator, | |
| 36097 | + isValidHeaderName, | |
| 36098 | + isValidHeaderValue | |
| 36099 | +} = __nccwpck_require__(5523) | |
| 36100 | +const util = __nccwpck_require__(9023) | |
| 36101 | +const { webidl } = __nccwpck_require__(4222) | |
| 36102 | +const assert = __nccwpck_require__(2613) | |
| 36103 | + | |
| 36104 | +const kHeadersMap = Symbol('headers map') | |
| 36105 | +const kHeadersSortedMap = Symbol('headers map sorted') | |
| 36106 | + | |
| 36107 | +/** | |
| 36108 | + * @param {number} code | |
| 36109 | + */ | |
| 36110 | +function isHTTPWhiteSpaceCharCode (code) { | |
| 36111 | + return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 | |
| 36112 | +} | |
| 36113 | + | |
| 36114 | +/** | |
| 36115 | + * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize | |
| 36116 | + * @param {string} potentialValue | |
| 36117 | + */ | |
| 36118 | +function headerValueNormalize (potentialValue) { | |
| 36119 | + // To normalize a byte sequence potentialValue, remove | |
| 36120 | + // any leading and trailing HTTP whitespace bytes from | |
| 36121 | + // potentialValue. | |
| 36122 | + let i = 0; let j = potentialValue.length | |
| 36123 | + | |
| 36124 | + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j | |
| 36125 | + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i | |
| 36126 | + | |
| 36127 | + return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) | |
| 36128 | +} | |
| 36129 | + | |
| 36130 | +function fill (headers, object) { | |
| 36131 | + // To fill a Headers object headers with a given object object, run these steps: | |
| 36132 | + | |
| 36133 | + // 1. If object is a sequence, then for each header in object: | |
| 36134 | + // Note: webidl conversion to array has already been done. | |
| 36135 | + if (Array.isArray(object)) { | |
| 36136 | + for (let i = 0; i < object.length; ++i) { | |
| 36137 | + const header = object[i] | |
| 36138 | + // 1. If header does not contain exactly two items, then throw a TypeError. | |
| 36139 | + if (header.length !== 2) { | |
| 36140 | + throw webidl.errors.exception({ | |
| 36141 | + header: 'Headers constructor', | |
| 36142 | + message: `expected name/value pair to be length 2, found ${header.length}.` | |
| 36143 | + }) | |
| 36144 | + } | |
| 36145 | + | |
| 36146 | + // 2. Append (header’s first item, header’s second item) to headers. | |
| 36147 | + appendHeader(headers, header[0], header[1]) | |
| 36148 | + } | |
| 36149 | + } else if (typeof object === 'object' && object !== null) { | |
| 36150 | + // Note: null should throw | |
| 36151 | + | |
| 36152 | + // 2. Otherwise, object is a record, then for each key → value in object, | |
| 36153 | + // append (key, value) to headers | |
| 36154 | + const keys = Object.keys(object) | |
| 36155 | + for (let i = 0; i < keys.length; ++i) { | |
| 36156 | + appendHeader(headers, keys[i], object[keys[i]]) | |
| 36157 | + } | |
| 36158 | + } else { | |
| 36159 | + throw webidl.errors.conversionFailed({ | |
| 36160 | + prefix: 'Headers constructor', | |
| 36161 | + argument: 'Argument 1', | |
| 36162 | + types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>'] | |
| 36163 | + }) | |
| 36164 | + } | |
| 36165 | +} | |
| 36166 | + | |
| 36167 | +/** | |
| 36168 | + * @see https://fetch.spec.whatwg.org/#concept-headers-append | |
| 36169 | + */ | |
| 36170 | +function appendHeader (headers, name, value) { | |
| 36171 | + // 1. Normalize value. | |
| 36172 | + value = headerValueNormalize(value) | |
| 36173 | + | |
| 36174 | + // 2. If name is not a header name or value is not a | |
| 36175 | + // header value, then throw a TypeError. | |
| 36176 | + if (!isValidHeaderName(name)) { | |
| 36177 | + throw webidl.errors.invalidArgument({ | |
| 36178 | + prefix: 'Headers.append', | |
| 36179 | + value: name, | |
| 36180 | + type: 'header name' | |
| 36181 | + }) | |
| 36182 | + } else if (!isValidHeaderValue(value)) { | |
| 36183 | + throw webidl.errors.invalidArgument({ | |
| 36184 | + prefix: 'Headers.append', | |
| 36185 | + value, | |
| 36186 | + type: 'header value' | |
| 36187 | + }) | |
| 36188 | + } | |
| 36189 | + | |
| 36190 | + // 3. If headers’s guard is "immutable", then throw a TypeError. | |
| 36191 | + // 4. Otherwise, if headers’s guard is "request" and name is a | |
| 36192 | + // forbidden header name, return. | |
| 36193 | + // Note: undici does not implement forbidden header names | |
| 36194 | + if (headers[kGuard] === 'immutable') { | |
| 36195 | + throw new TypeError('immutable') | |
| 36196 | + } else if (headers[kGuard] === 'request-no-cors') { | |
| 36197 | + // 5. Otherwise, if headers’s guard is "request-no-cors": | |
| 36198 | + // TODO | |
| 36199 | + } | |
| 36200 | + | |
| 36201 | + // 6. Otherwise, if headers’s guard is "response" and name is a | |
| 36202 | + // forbidden response-header name, return. | |
| 36203 | + | |
| 36204 | + // 7. Append (name, value) to headers’s header list. | |
| 36205 | + return headers[kHeadersList].append(name, value) | |
| 36206 | + | |
| 36207 | + // 8. If headers’s guard is "request-no-cors", then remove | |
| 36208 | + // privileged no-CORS request headers from headers | |
| 36209 | +} | |
| 36210 | + | |
| 36211 | +class HeadersList { | |
| 36212 | + /** @type {[string, string][]|null} */ | |
| 36213 | + cookies = null | |
| 36214 | + | |
| 36215 | + constructor (init) { | |
| 36216 | + if (init instanceof HeadersList) { | |
| 36217 | + this[kHeadersMap] = new Map(init[kHeadersMap]) | |
| 36218 | + this[kHeadersSortedMap] = init[kHeadersSortedMap] | |
| 36219 | + this.cookies = init.cookies === null ? null : [...init.cookies] | |
| 36220 | + } else { | |
| 36221 | + this[kHeadersMap] = new Map(init) | |
| 36222 | + this[kHeadersSortedMap] = null | |
| 36223 | + } | |
| 36224 | + } | |
| 36225 | + | |
| 36226 | + // https://fetch.spec.whatwg.org/#header-list-contains | |
| 36227 | + contains (name) { | |
| 36228 | + // A header list list contains a header name name if list | |
| 36229 | + // contains a header whose name is a byte-case-insensitive | |
| 36230 | + // match for name. | |
| 36231 | + name = name.toLowerCase() | |
| 36232 | + | |
| 36233 | + return this[kHeadersMap].has(name) | |
| 36234 | + } | |
| 36235 | + | |
| 36236 | + clear () { | |
| 36237 | + this[kHeadersMap].clear() | |
| 36238 | + this[kHeadersSortedMap] = null | |
| 36239 | + this.cookies = null | |
| 36240 | + } | |
| 36241 | + | |
| 36242 | + // https://fetch.spec.whatwg.org/#concept-header-list-append | |
| 36243 | + append (name, value) { | |
| 36244 | + this[kHeadersSortedMap] = null | |
| 36245 | + | |
| 36246 | + // 1. If list contains name, then set name to the first such | |
| 36247 | + // header’s name. | |
| 36248 | + const lowercaseName = name.toLowerCase() | |
| 36249 | + const exists = this[kHeadersMap].get(lowercaseName) | |
| 36250 | + | |
| 36251 | + // 2. Append (name, value) to list. | |
| 36252 | + if (exists) { | |
| 36253 | + const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' | |
| 36254 | + this[kHeadersMap].set(lowercaseName, { | |
| 36255 | + name: exists.name, | |
| 36256 | + value: `${exists.value}${delimiter}${value}` | |
| 36257 | + }) | |
| 36258 | + } else { | |
| 36259 | + this[kHeadersMap].set(lowercaseName, { name, value }) | |
| 36260 | + } | |
| 36261 | + | |
| 36262 | + if (lowercaseName === 'set-cookie') { | |
| 36263 | + this.cookies ??= [] | |
| 36264 | + this.cookies.push(value) | |
| 36265 | + } | |
| 36266 | + } | |
| 36267 | + | |
| 36268 | + // https://fetch.spec.whatwg.org/#concept-header-list-set | |
| 36269 | + set (name, value) { | |
| 36270 | + this[kHeadersSortedMap] = null | |
| 36271 | + const lowercaseName = name.toLowerCase() | |
| 36272 | + | |
| 36273 | + if (lowercaseName === 'set-cookie') { | |
| 36274 | + this.cookies = [value] | |
| 36275 | + } | |
| 36276 | + | |
| 36277 | + // 1. If list contains name, then set the value of | |
| 36278 | + // the first such header to value and remove the | |
| 36279 | + // others. | |
| 36280 | + // 2. Otherwise, append header (name, value) to list. | |
| 36281 | + this[kHeadersMap].set(lowercaseName, { name, value }) | |
| 36282 | + } | |
| 36283 | + | |
| 36284 | + // https://fetch.spec.whatwg.org/#concept-header-list-delete | |
| 36285 | + delete (name) { | |
| 36286 | + this[kHeadersSortedMap] = null | |
| 36287 | + | |
| 36288 | + name = name.toLowerCase() | |
| 36289 | + | |
| 36290 | + if (name === 'set-cookie') { | |
| 36291 | + this.cookies = null | |
| 36292 | + } | |
| 36293 | + | |
| 36294 | + this[kHeadersMap].delete(name) | |
| 36295 | + } | |
| 36296 | + | |
| 36297 | + // https://fetch.spec.whatwg.org/#concept-header-list-get | |
| 36298 | + get (name) { | |
| 36299 | + const value = this[kHeadersMap].get(name.toLowerCase()) | |
| 36300 | + | |
| 36301 | + // 1. If list does not contain name, then return null. | |
| 36302 | + // 2. Return the values of all headers in list whose name | |
| 36303 | + // is a byte-case-insensitive match for name, | |
| 36304 | + // separated from each other by 0x2C 0x20, in order. | |
| 36305 | + return value === undefined ? null : value.value | |
| 36306 | + } | |
| 36307 | + | |
| 36308 | + * [Symbol.iterator] () { | |
| 36309 | + // use the lowercased name | |
| 36310 | + for (const [name, { value }] of this[kHeadersMap]) { | |
| 36311 | + yield [name, value] | |
| 36312 | + } | |
| 36313 | + } | |
| 36314 | + | |
| 36315 | + get entries () { | |
| 36316 | + const headers = {} | |
| 36317 | + | |
| 36318 | + if (this[kHeadersMap].size) { | |
| 36319 | + for (const { name, value } of this[kHeadersMap].values()) { | |
| 36320 | + headers[name] = value | |
| 36321 | + } | |
| 36322 | + } | |
| 36323 | + | |
| 36324 | + return headers | |
| 36325 | + } | |
| 36326 | +} | |
| 36327 | + | |
| 36328 | +// https://fetch.spec.whatwg.org/#headers-class | |
| 36329 | +class Headers { | |
| 36330 | + constructor (init = undefined) { | |
| 36331 | + if (init === kConstruct) { | |
| 36332 | + return | |
| 36333 | + } | |
| 36334 | + this[kHeadersList] = new HeadersList() | |
| 36335 | + | |
| 36336 | + // The new Headers(init) constructor steps are: | |
| 36337 | + | |
| 36338 | + // 1. Set this’s guard to "none". | |
| 36339 | + this[kGuard] = 'none' | |
| 36340 | + | |
| 36341 | + // 2. If init is given, then fill this with init. | |
| 36342 | + if (init !== undefined) { | |
| 36343 | + init = webidl.converters.HeadersInit(init) | |
| 36344 | + fill(this, init) | |
| 36345 | + } | |
| 36346 | + } | |
| 36347 | + | |
| 36348 | + // https://fetch.spec.whatwg.org/#dom-headers-append | |
| 36349 | + append (name, value) { | |
| 36350 | + webidl.brandCheck(this, Headers) | |
| 36351 | + | |
| 36352 | + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) | |
| 36353 | + | |
| 36354 | + name = webidl.converters.ByteString(name) | |
| 36355 | + value = webidl.converters.ByteString(value) | |
| 36356 | + | |
| 36357 | + return appendHeader(this, name, value) | |
| 36358 | + } | |
| 36359 | + | |
| 36360 | + // https://fetch.spec.whatwg.org/#dom-headers-delete | |
| 36361 | + delete (name) { | |
| 36362 | + webidl.brandCheck(this, Headers) | |
| 36363 | + | |
| 36364 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) | |
| 36365 | + | |
| 36366 | + name = webidl.converters.ByteString(name) | |
| 36367 | + | |
| 36368 | + // 1. If name is not a header name, then throw a TypeError. | |
| 36369 | + if (!isValidHeaderName(name)) { | |
| 36370 | + throw webidl.errors.invalidArgument({ | |
| 36371 | + prefix: 'Headers.delete', | |
| 36372 | + value: name, | |
| 36373 | + type: 'header name' | |
| 36374 | + }) | |
| 36375 | + } | |
| 36376 | + | |
| 36377 | + // 2. If this’s guard is "immutable", then throw a TypeError. | |
| 36378 | + // 3. Otherwise, if this’s guard is "request" and name is a | |
| 36379 | + // forbidden header name, return. | |
| 36380 | + // 4. Otherwise, if this’s guard is "request-no-cors", name | |
| 36381 | + // is not a no-CORS-safelisted request-header name, and | |
| 36382 | + // name is not a privileged no-CORS request-header name, | |
| 36383 | + // return. | |
| 36384 | + // 5. Otherwise, if this’s guard is "response" and name is | |
| 36385 | + // a forbidden response-header name, return. | |
| 36386 | + // Note: undici does not implement forbidden header names | |
| 36387 | + if (this[kGuard] === 'immutable') { | |
| 36388 | + throw new TypeError('immutable') | |
| 36389 | + } else if (this[kGuard] === 'request-no-cors') { | |
| 36390 | + // TODO | |
| 36391 | + } | |
| 36392 | + | |
| 36393 | + // 6. If this’s header list does not contain name, then | |
| 36394 | + // return. | |
| 36395 | + if (!this[kHeadersList].contains(name)) { | |
| 36396 | + return | |
| 36397 | + } | |
| 36398 | + | |
| 36399 | + // 7. Delete name from this’s header list. | |
| 36400 | + // 8. If this’s guard is "request-no-cors", then remove | |
| 36401 | + // privileged no-CORS request headers from this. | |
| 36402 | + this[kHeadersList].delete(name) | |
| 36403 | + } | |
| 36404 | + | |
| 36405 | + // https://fetch.spec.whatwg.org/#dom-headers-get | |
| 36406 | + get (name) { | |
| 36407 | + webidl.brandCheck(this, Headers) | |
| 36408 | + | |
| 36409 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) | |
| 36410 | + | |
| 36411 | + name = webidl.converters.ByteString(name) | |
| 36412 | + | |
| 36413 | + // 1. If name is not a header name, then throw a TypeError. | |
| 36414 | + if (!isValidHeaderName(name)) { | |
| 36415 | + throw webidl.errors.invalidArgument({ | |
| 36416 | + prefix: 'Headers.get', | |
| 36417 | + value: name, | |
| 36418 | + type: 'header name' | |
| 36419 | + }) | |
| 36420 | + } | |
| 36421 | + | |
| 36422 | + // 2. Return the result of getting name from this’s header | |
| 36423 | + // list. | |
| 36424 | + return this[kHeadersList].get(name) | |
| 36425 | + } | |
| 36426 | + | |
| 36427 | + // https://fetch.spec.whatwg.org/#dom-headers-has | |
| 36428 | + has (name) { | |
| 36429 | + webidl.brandCheck(this, Headers) | |
| 36430 | + | |
| 36431 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) | |
| 36432 | + | |
| 36433 | + name = webidl.converters.ByteString(name) | |
| 36434 | + | |
| 36435 | + // 1. If name is not a header name, then throw a TypeError. | |
| 36436 | + if (!isValidHeaderName(name)) { | |
| 36437 | + throw webidl.errors.invalidArgument({ | |
| 36438 | + prefix: 'Headers.has', | |
| 36439 | + value: name, | |
| 36440 | + type: 'header name' | |
| 36441 | + }) | |
| 36442 | + } | |
| 36443 | + | |
| 36444 | + // 2. Return true if this’s header list contains name; | |
| 36445 | + // otherwise false. | |
| 36446 | + return this[kHeadersList].contains(name) | |
| 36447 | + } | |
| 36448 | + | |
| 36449 | + // https://fetch.spec.whatwg.org/#dom-headers-set | |
| 36450 | + set (name, value) { | |
| 36451 | + webidl.brandCheck(this, Headers) | |
| 36452 | + | |
| 36453 | + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) | |
| 36454 | + | |
| 36455 | + name = webidl.converters.ByteString(name) | |
| 36456 | + value = webidl.converters.ByteString(value) | |
| 36457 | + | |
| 36458 | + // 1. Normalize value. | |
| 36459 | + value = headerValueNormalize(value) | |
| 36460 | + | |
| 36461 | + // 2. If name is not a header name or value is not a | |
| 36462 | + // header value, then throw a TypeError. | |
| 36463 | + if (!isValidHeaderName(name)) { | |
| 36464 | + throw webidl.errors.invalidArgument({ | |
| 36465 | + prefix: 'Headers.set', | |
| 36466 | + value: name, | |
| 36467 | + type: 'header name' | |
| 36468 | + }) | |
| 36469 | + } else if (!isValidHeaderValue(value)) { | |
| 36470 | + throw webidl.errors.invalidArgument({ | |
| 36471 | + prefix: 'Headers.set', | |
| 36472 | + value, | |
| 36473 | + type: 'header value' | |
| 36474 | + }) | |
| 36475 | + } | |
| 36476 | + | |
| 36477 | + // 3. If this’s guard is "immutable", then throw a TypeError. | |
| 36478 | + // 4. Otherwise, if this’s guard is "request" and name is a | |
| 36479 | + // forbidden header name, return. | |
| 36480 | + // 5. Otherwise, if this’s guard is "request-no-cors" and | |
| 36481 | + // name/value is not a no-CORS-safelisted request-header, | |
| 36482 | + // return. | |
| 36483 | + // 6. Otherwise, if this’s guard is "response" and name is a | |
| 36484 | + // forbidden response-header name, return. | |
| 36485 | + // Note: undici does not implement forbidden header names | |
| 36486 | + if (this[kGuard] === 'immutable') { | |
| 36487 | + throw new TypeError('immutable') | |
| 36488 | + } else if (this[kGuard] === 'request-no-cors') { | |
| 36489 | + // TODO | |
| 36490 | + } | |
| 36491 | + | |
| 36492 | + // 7. Set (name, value) in this’s header list. | |
| 36493 | + // 8. If this’s guard is "request-no-cors", then remove | |
| 36494 | + // privileged no-CORS request headers from this | |
| 36495 | + this[kHeadersList].set(name, value) | |
| 36496 | + } | |
| 36497 | + | |
| 36498 | + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie | |
| 36499 | + getSetCookie () { | |
| 36500 | + webidl.brandCheck(this, Headers) | |
| 36501 | + | |
| 36502 | + // 1. If this’s header list does not contain `Set-Cookie`, then return « ». | |
| 36503 | + // 2. Return the values of all headers in this’s header list whose name is | |
| 36504 | + // a byte-case-insensitive match for `Set-Cookie`, in order. | |
| 36505 | + | |
| 36506 | + const list = this[kHeadersList].cookies | |
| 36507 | + | |
| 36508 | + if (list) { | |
| 36509 | + return [...list] | |
| 36510 | + } | |
| 36511 | + | |
| 36512 | + return [] | |
| 36513 | + } | |
| 36514 | + | |
| 36515 | + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine | |
| 36516 | + get [kHeadersSortedMap] () { | |
| 36517 | + if (this[kHeadersList][kHeadersSortedMap]) { | |
| 36518 | + return this[kHeadersList][kHeadersSortedMap] | |
| 36519 | + } | |
| 36520 | + | |
| 36521 | + // 1. Let headers be an empty list of headers with the key being the name | |
| 36522 | + // and value the value. | |
| 36523 | + const headers = [] | |
| 36524 | + | |
| 36525 | + // 2. Let names be the result of convert header names to a sorted-lowercase | |
| 36526 | + // set with all the names of the headers in list. | |
| 36527 | + const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) | |
| 36528 | + const cookies = this[kHeadersList].cookies | |
| 36529 | + | |
| 36530 | + // 3. For each name of names: | |
| 36531 | + for (let i = 0; i < names.length; ++i) { | |
| 36532 | + const [name, value] = names[i] | |
| 36533 | + // 1. If name is `set-cookie`, then: | |
| 36534 | + if (name === 'set-cookie') { | |
| 36535 | + // 1. Let values be a list of all values of headers in list whose name | |
| 36536 | + // is a byte-case-insensitive match for name, in order. | |
| 36537 | + | |
| 36538 | + // 2. For each value of values: | |
| 36539 | + // 1. Append (name, value) to headers. | |
| 36540 | + for (let j = 0; j < cookies.length; ++j) { | |
| 36541 | + headers.push([name, cookies[j]]) | |
| 36542 | + } | |
| 36543 | + } else { | |
| 36544 | + // 2. Otherwise: | |
| 36545 | + | |
| 36546 | + // 1. Let value be the result of getting name from list. | |
| 36547 | + | |
| 36548 | + // 2. Assert: value is non-null. | |
| 36549 | + assert(value !== null) | |
| 36550 | + | |
| 36551 | + // 3. Append (name, value) to headers. | |
| 36552 | + headers.push([name, value]) | |
| 36553 | + } | |
| 36554 | + } | |
| 36555 | + | |
| 36556 | + this[kHeadersList][kHeadersSortedMap] = headers | |
| 36557 | + | |
| 36558 | + // 4. Return headers. | |
| 36559 | + return headers | |
| 36560 | + } | |
| 36561 | + | |
| 36562 | + keys () { | |
| 36563 | + webidl.brandCheck(this, Headers) | |
| 36564 | + | |
| 36565 | + if (this[kGuard] === 'immutable') { | |
| 36566 | + const value = this[kHeadersSortedMap] | |
| 36567 | + return makeIterator(() => value, 'Headers', | |
| 36568 | + 'key') | |
| 36569 | + } | |
| 36570 | + | |
| 36571 | + return makeIterator( | |
| 36572 | + () => [...this[kHeadersSortedMap].values()], | |
| 36573 | + 'Headers', | |
| 36574 | + 'key' | |
| 36575 | + ) | |
| 36576 | + } | |
| 36577 | + | |
| 36578 | + values () { | |
| 36579 | + webidl.brandCheck(this, Headers) | |
| 36580 | + | |
| 36581 | + if (this[kGuard] === 'immutable') { | |
| 36582 | + const value = this[kHeadersSortedMap] | |
| 36583 | + return makeIterator(() => value, 'Headers', | |
| 36584 | + 'value') | |
| 36585 | + } | |
| 36586 | + | |
| 36587 | + return makeIterator( | |
| 36588 | + () => [...this[kHeadersSortedMap].values()], | |
| 36589 | + 'Headers', | |
| 36590 | + 'value' | |
| 36591 | + ) | |
| 36592 | + } | |
| 36593 | + | |
| 36594 | + entries () { | |
| 36595 | + webidl.brandCheck(this, Headers) | |
| 36596 | + | |
| 36597 | + if (this[kGuard] === 'immutable') { | |
| 36598 | + const value = this[kHeadersSortedMap] | |
| 36599 | + return makeIterator(() => value, 'Headers', | |
| 36600 | + 'key+value') | |
| 36601 | + } | |
| 36602 | + | |
| 36603 | + return makeIterator( | |
| 36604 | + () => [...this[kHeadersSortedMap].values()], | |
| 36605 | + 'Headers', | |
| 36606 | + 'key+value' | |
| 36607 | + ) | |
| 36608 | + } | |
| 36609 | + | |
| 36610 | + /** | |
| 36611 | + * @param {(value: string, key: string, self: Headers) => void} callbackFn | |
| 36612 | + * @param {unknown} thisArg | |
| 36613 | + */ | |
| 36614 | + forEach (callbackFn, thisArg = globalThis) { | |
| 36615 | + webidl.brandCheck(this, Headers) | |
| 36616 | + | |
| 36617 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) | |
| 36618 | + | |
| 36619 | + if (typeof callbackFn !== 'function') { | |
| 36620 | + throw new TypeError( | |
| 36621 | + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." | |
| 36622 | + ) | |
| 36623 | + } | |
| 36624 | + | |
| 36625 | + for (const [key, value] of this) { | |
| 36626 | + callbackFn.apply(thisArg, [value, key, this]) | |
| 36627 | + } | |
| 36628 | + } | |
| 36629 | + | |
| 36630 | + [Symbol.for('nodejs.util.inspect.custom')] () { | |
| 36631 | + webidl.brandCheck(this, Headers) | |
| 36632 | + | |
| 36633 | + return this[kHeadersList] | |
| 36634 | + } | |
| 36635 | +} | |
| 36636 | + | |
| 36637 | +Headers.prototype[Symbol.iterator] = Headers.prototype.entries | |
| 36638 | + | |
| 36639 | +Object.defineProperties(Headers.prototype, { | |
| 36640 | + append: kEnumerableProperty, | |
| 36641 | + delete: kEnumerableProperty, | |
| 36642 | + get: kEnumerableProperty, | |
| 36643 | + has: kEnumerableProperty, | |
| 36644 | + set: kEnumerableProperty, | |
| 36645 | + getSetCookie: kEnumerableProperty, | |
| 36646 | + keys: kEnumerableProperty, | |
| 36647 | + values: kEnumerableProperty, | |
| 36648 | + entries: kEnumerableProperty, | |
| 36649 | + forEach: kEnumerableProperty, | |
| 36650 | + [Symbol.iterator]: { enumerable: false }, | |
| 36651 | + [Symbol.toStringTag]: { | |
| 36652 | + value: 'Headers', | |
| 36653 | + configurable: true | |
| 36654 | + }, | |
| 36655 | + [util.inspect.custom]: { | |
| 36656 | + enumerable: false | |
| 36657 | + } | |
| 36658 | +}) | |
| 36659 | + | |
| 36660 | +webidl.converters.HeadersInit = function (V) { | |
| 36661 | + if (webidl.util.Type(V) === 'Object') { | |
| 36662 | + if (V[Symbol.iterator]) { | |
| 36663 | + return webidl.converters['sequence<sequence<ByteString>>'](V) | |
| 36664 | + } | |
| 36665 | + | |
| 36666 | + return webidl.converters['record<ByteString, ByteString>'](V) | |
| 36667 | + } | |
| 36668 | + | |
| 36669 | + throw webidl.errors.conversionFailed({ | |
| 36670 | + prefix: 'Headers constructor', | |
| 36671 | + argument: 'Argument 1', | |
| 36672 | + types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>'] | |
| 36673 | + }) | |
| 36674 | +} | |
| 36675 | + | |
| 36676 | +module.exports = { | |
| 36677 | + fill, | |
| 36678 | + Headers, | |
| 36679 | + HeadersList | |
| 36680 | +} | |
| 36681 | + | |
| 36682 | + | |
| 36683 | +/***/ }), | |
| 36684 | + | |
| 36685 | +/***/ 2315: | |
| 36686 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 36687 | + | |
| 36688 | +"use strict"; | |
| 36689 | +// https://github.com/Ethan-Arrowood/undici-fetch | |
| 36690 | + | |
| 36691 | + | |
| 36692 | + | |
| 36693 | +const { | |
| 36694 | + Response, | |
| 36695 | + makeNetworkError, | |
| 36696 | + makeAppropriateNetworkError, | |
| 36697 | + filterResponse, | |
| 36698 | + makeResponse | |
| 36699 | +} = __nccwpck_require__(8676) | |
| 36700 | +const { Headers } = __nccwpck_require__(6349) | |
| 36701 | +const { Request, makeRequest } = __nccwpck_require__(5194) | |
| 36702 | +const zlib = __nccwpck_require__(3106) | |
| 36703 | +const { | |
| 36704 | + bytesMatch, | |
| 36705 | + makePolicyContainer, | |
| 36706 | + clonePolicyContainer, | |
| 36707 | + requestBadPort, | |
| 36708 | + TAOCheck, | |
| 36709 | + appendRequestOriginHeader, | |
| 36710 | + responseLocationURL, | |
| 36711 | + requestCurrentURL, | |
| 36712 | + setRequestReferrerPolicyOnRedirect, | |
| 36713 | + tryUpgradeRequestToAPotentiallyTrustworthyURL, | |
| 36714 | + createOpaqueTimingInfo, | |
| 36715 | + appendFetchMetadata, | |
| 36716 | + corsCheck, | |
| 36717 | + crossOriginResourcePolicyCheck, | |
| 36718 | + determineRequestsReferrer, | |
| 36719 | + coarsenedSharedCurrentTime, | |
| 36720 | + createDeferredPromise, | |
| 36721 | + isBlobLike, | |
| 36722 | + sameOrigin, | |
| 36723 | + isCancelled, | |
| 36724 | + isAborted, | |
| 36725 | + isErrorLike, | |
| 36726 | + fullyReadBody, | |
| 36727 | + readableStreamClose, | |
| 36728 | + isomorphicEncode, | |
| 36729 | + urlIsLocal, | |
| 36730 | + urlIsHttpHttpsScheme, | |
| 36731 | + urlHasHttpsScheme | |
| 36732 | +} = __nccwpck_require__(5523) | |
| 36733 | +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) | |
| 36734 | +const assert = __nccwpck_require__(2613) | |
| 36735 | +const { safelyExtractBody } = __nccwpck_require__(8923) | |
| 36736 | +const { | |
| 36737 | + redirectStatusSet, | |
| 36738 | + nullBodyStatus, | |
| 36739 | + safeMethodsSet, | |
| 36740 | + requestBodyHeader, | |
| 36741 | + subresourceSet, | |
| 36742 | + DOMException | |
| 36743 | +} = __nccwpck_require__(7326) | |
| 36744 | +const { kHeadersList } = __nccwpck_require__(6443) | |
| 36745 | +const EE = __nccwpck_require__(4434) | |
| 36746 | +const { Readable, pipeline } = __nccwpck_require__(2203) | |
| 36747 | +const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3440) | |
| 36748 | +const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(4322) | |
| 36749 | +const { TransformStream } = __nccwpck_require__(3774) | |
| 36750 | +const { getGlobalDispatcher } = __nccwpck_require__(2581) | |
| 36751 | +const { webidl } = __nccwpck_require__(4222) | |
| 36752 | +const { STATUS_CODES } = __nccwpck_require__(8611) | |
| 36753 | +const GET_OR_HEAD = ['GET', 'HEAD'] | |
| 36754 | + | |
| 36755 | +/** @type {import('buffer').resolveObjectURL} */ | |
| 36756 | +let resolveObjectURL | |
| 36757 | +let ReadableStream = globalThis.ReadableStream | |
| 36758 | + | |
| 36759 | +class Fetch extends EE { | |
| 36760 | + constructor (dispatcher) { | |
| 36761 | + super() | |
| 36762 | + | |
| 36763 | + this.dispatcher = dispatcher | |
| 36764 | + this.connection = null | |
| 36765 | + this.dump = false | |
| 36766 | + this.state = 'ongoing' | |
| 36767 | + // 2 terminated listeners get added per request, | |
| 36768 | + // but only 1 gets removed. If there are 20 redirects, | |
| 36769 | + // 21 listeners will be added. | |
| 36770 | + // See https://github.com/nodejs/undici/issues/1711 | |
| 36771 | + // TODO (fix): Find and fix root cause for leaked listener. | |
| 36772 | + this.setMaxListeners(21) | |
| 36773 | + } | |
| 36774 | + | |
| 36775 | + terminate (reason) { | |
| 36776 | + if (this.state !== 'ongoing') { | |
| 36777 | + return | |
| 36778 | + } | |
| 36779 | + | |
| 36780 | + this.state = 'terminated' | |
| 36781 | + this.connection?.destroy(reason) | |
| 36782 | + this.emit('terminated', reason) | |
| 36783 | + } | |
| 36784 | + | |
| 36785 | + // https://fetch.spec.whatwg.org/#fetch-controller-abort | |
| 36786 | + abort (error) { | |
| 36787 | + if (this.state !== 'ongoing') { | |
| 36788 | + return | |
| 36789 | + } | |
| 36790 | + | |
| 36791 | + // 1. Set controller’s state to "aborted". | |
| 36792 | + this.state = 'aborted' | |
| 36793 | + | |
| 36794 | + // 2. Let fallbackError be an "AbortError" DOMException. | |
| 36795 | + // 3. Set error to fallbackError if it is not given. | |
| 36796 | + if (!error) { | |
| 36797 | + error = new DOMException('The operation was aborted.', 'AbortError') | |
| 36798 | + } | |
| 36799 | + | |
| 36800 | + // 4. Let serializedError be StructuredSerialize(error). | |
| 36801 | + // If that threw an exception, catch it, and let | |
| 36802 | + // serializedError be StructuredSerialize(fallbackError). | |
| 36803 | + | |
| 36804 | + // 5. Set controller’s serialized abort reason to serializedError. | |
| 36805 | + this.serializedAbortReason = error | |
| 36806 | + | |
| 36807 | + this.connection?.destroy(error) | |
| 36808 | + this.emit('terminated', error) | |
| 36809 | + } | |
| 36810 | +} | |
| 36811 | + | |
| 36812 | +// https://fetch.spec.whatwg.org/#fetch-method | |
| 36813 | +function fetch (input, init = {}) { | |
| 36814 | + webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) | |
| 36815 | + | |
| 36816 | + // 1. Let p be a new promise. | |
| 36817 | + const p = createDeferredPromise() | |
| 36818 | + | |
| 36819 | + // 2. Let requestObject be the result of invoking the initial value of | |
| 36820 | + // Request as constructor with input and init as arguments. If this throws | |
| 36821 | + // an exception, reject p with it and return p. | |
| 36822 | + let requestObject | |
| 36823 | + | |
| 36824 | + try { | |
| 36825 | + requestObject = new Request(input, init) | |
| 36826 | + } catch (e) { | |
| 36827 | + p.reject(e) | |
| 36828 | + return p.promise | |
| 36829 | + } | |
| 36830 | + | |
| 36831 | + // 3. Let request be requestObject’s request. | |
| 36832 | + const request = requestObject[kState] | |
| 36833 | + | |
| 36834 | + // 4. If requestObject’s signal’s aborted flag is set, then: | |
| 36835 | + if (requestObject.signal.aborted) { | |
| 36836 | + // 1. Abort the fetch() call with p, request, null, and | |
| 36837 | + // requestObject’s signal’s abort reason. | |
| 36838 | + abortFetch(p, request, null, requestObject.signal.reason) | |
| 36839 | + | |
| 36840 | + // 2. Return p. | |
| 36841 | + return p.promise | |
| 36842 | + } | |
| 36843 | + | |
| 36844 | + // 5. Let globalObject be request’s client’s global object. | |
| 36845 | + const globalObject = request.client.globalObject | |
| 36846 | + | |
| 36847 | + // 6. If globalObject is a ServiceWorkerGlobalScope object, then set | |
| 36848 | + // request’s service-workers mode to "none". | |
| 36849 | + if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { | |
| 36850 | + request.serviceWorkers = 'none' | |
| 36851 | + } | |
| 36852 | + | |
| 36853 | + // 7. Let responseObject be null. | |
| 36854 | + let responseObject = null | |
| 36855 | + | |
| 36856 | + // 8. Let relevantRealm be this’s relevant Realm. | |
| 36857 | + const relevantRealm = null | |
| 36858 | + | |
| 36859 | + // 9. Let locallyAborted be false. | |
| 36860 | + let locallyAborted = false | |
| 36861 | + | |
| 36862 | + // 10. Let controller be null. | |
| 36863 | + let controller = null | |
| 36864 | + | |
| 36865 | + // 11. Add the following abort steps to requestObject’s signal: | |
| 36866 | + addAbortListener( | |
| 36867 | + requestObject.signal, | |
| 36868 | + () => { | |
| 36869 | + // 1. Set locallyAborted to true. | |
| 36870 | + locallyAborted = true | |
| 36871 | + | |
| 36872 | + // 2. Assert: controller is non-null. | |
| 36873 | + assert(controller != null) | |
| 36874 | + | |
| 36875 | + // 3. Abort controller with requestObject’s signal’s abort reason. | |
| 36876 | + controller.abort(requestObject.signal.reason) | |
| 36877 | + | |
| 36878 | + // 4. Abort the fetch() call with p, request, responseObject, | |
| 36879 | + // and requestObject’s signal’s abort reason. | |
| 36880 | + abortFetch(p, request, responseObject, requestObject.signal.reason) | |
| 36881 | + } | |
| 36882 | + ) | |
| 36883 | + | |
| 36884 | + // 12. Let handleFetchDone given response response be to finalize and | |
| 36885 | + // report timing with response, globalObject, and "fetch". | |
| 36886 | + const handleFetchDone = (response) => | |
| 36887 | + finalizeAndReportTiming(response, 'fetch') | |
| 36888 | + | |
| 36889 | + // 13. Set controller to the result of calling fetch given request, | |
| 36890 | + // with processResponseEndOfBody set to handleFetchDone, and processResponse | |
| 36891 | + // given response being these substeps: | |
| 36892 | + | |
| 36893 | + const processResponse = (response) => { | |
| 36894 | + // 1. If locallyAborted is true, terminate these substeps. | |
| 36895 | + if (locallyAborted) { | |
| 36896 | + return Promise.resolve() | |
| 36897 | + } | |
| 36898 | + | |
| 36899 | + // 2. If response’s aborted flag is set, then: | |
| 36900 | + if (response.aborted) { | |
| 36901 | + // 1. Let deserializedError be the result of deserialize a serialized | |
| 36902 | + // abort reason given controller’s serialized abort reason and | |
| 36903 | + // relevantRealm. | |
| 36904 | + | |
| 36905 | + // 2. Abort the fetch() call with p, request, responseObject, and | |
| 36906 | + // deserializedError. | |
| 36907 | + | |
| 36908 | + abortFetch(p, request, responseObject, controller.serializedAbortReason) | |
| 36909 | + return Promise.resolve() | |
| 36910 | + } | |
| 36911 | + | |
| 36912 | + // 3. If response is a network error, then reject p with a TypeError | |
| 36913 | + // and terminate these substeps. | |
| 36914 | + if (response.type === 'error') { | |
| 36915 | + p.reject( | |
| 36916 | + Object.assign(new TypeError('fetch failed'), { cause: response.error }) | |
| 36917 | + ) | |
| 36918 | + return Promise.resolve() | |
| 36919 | + } | |
| 36920 | + | |
| 36921 | + // 4. Set responseObject to the result of creating a Response object, | |
| 36922 | + // given response, "immutable", and relevantRealm. | |
| 36923 | + responseObject = new Response() | |
| 36924 | + responseObject[kState] = response | |
| 36925 | + responseObject[kRealm] = relevantRealm | |
| 36926 | + responseObject[kHeaders][kHeadersList] = response.headersList | |
| 36927 | + responseObject[kHeaders][kGuard] = 'immutable' | |
| 36928 | + responseObject[kHeaders][kRealm] = relevantRealm | |
| 36929 | + | |
| 36930 | + // 5. Resolve p with responseObject. | |
| 36931 | + p.resolve(responseObject) | |
| 36932 | + } | |
| 36933 | + | |
| 36934 | + controller = fetching({ | |
| 36935 | + request, | |
| 36936 | + processResponseEndOfBody: handleFetchDone, | |
| 36937 | + processResponse, | |
| 36938 | + dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici | |
| 36939 | + }) | |
| 36940 | + | |
| 36941 | + // 14. Return p. | |
| 36942 | + return p.promise | |
| 36943 | +} | |
| 36944 | + | |
| 36945 | +// https://fetch.spec.whatwg.org/#finalize-and-report-timing | |
| 36946 | +function finalizeAndReportTiming (response, initiatorType = 'other') { | |
| 36947 | + // 1. If response is an aborted network error, then return. | |
| 36948 | + if (response.type === 'error' && response.aborted) { | |
| 36949 | + return | |
| 36950 | + } | |
| 36951 | + | |
| 36952 | + // 2. If response’s URL list is null or empty, then return. | |
| 36953 | + if (!response.urlList?.length) { | |
| 36954 | + return | |
| 36955 | + } | |
| 36956 | + | |
| 36957 | + // 3. Let originalURL be response’s URL list[0]. | |
| 36958 | + const originalURL = response.urlList[0] | |
| 36959 | + | |
| 36960 | + // 4. Let timingInfo be response’s timing info. | |
| 36961 | + let timingInfo = response.timingInfo | |
| 36962 | + | |
| 36963 | + // 5. Let cacheState be response’s cache state. | |
| 36964 | + let cacheState = response.cacheState | |
| 36965 | + | |
| 36966 | + // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. | |
| 36967 | + if (!urlIsHttpHttpsScheme(originalURL)) { | |
| 36968 | + return | |
| 36969 | + } | |
| 36970 | + | |
| 36971 | + // 7. If timingInfo is null, then return. | |
| 36972 | + if (timingInfo === null) { | |
| 36973 | + return | |
| 36974 | + } | |
| 36975 | + | |
| 36976 | + // 8. If response’s timing allow passed flag is not set, then: | |
| 36977 | + if (!response.timingAllowPassed) { | |
| 36978 | + // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. | |
| 36979 | + timingInfo = createOpaqueTimingInfo({ | |
| 36980 | + startTime: timingInfo.startTime | |
| 36981 | + }) | |
| 36982 | + | |
| 36983 | + // 2. Set cacheState to the empty string. | |
| 36984 | + cacheState = '' | |
| 36985 | + } | |
| 36986 | + | |
| 36987 | + // 9. Set timingInfo’s end time to the coarsened shared current time | |
| 36988 | + // given global’s relevant settings object’s cross-origin isolated | |
| 36989 | + // capability. | |
| 36990 | + // TODO: given global’s relevant settings object’s cross-origin isolated | |
| 36991 | + // capability? | |
| 36992 | + timingInfo.endTime = coarsenedSharedCurrentTime() | |
| 36993 | + | |
| 36994 | + // 10. Set response’s timing info to timingInfo. | |
| 36995 | + response.timingInfo = timingInfo | |
| 36996 | + | |
| 36997 | + // 11. Mark resource timing for timingInfo, originalURL, initiatorType, | |
| 36998 | + // global, and cacheState. | |
| 36999 | + markResourceTiming( | |
| 37000 | + timingInfo, | |
| 37001 | + originalURL, | |
| 37002 | + initiatorType, | |
| 37003 | + globalThis, | |
| 37004 | + cacheState | |
| 37005 | + ) | |
| 37006 | +} | |
| 37007 | + | |
| 37008 | +// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing | |
| 37009 | +function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { | |
| 37010 | + if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { | |
| 37011 | + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) | |
| 37012 | + } | |
| 37013 | +} | |
| 37014 | + | |
| 37015 | +// https://fetch.spec.whatwg.org/#abort-fetch | |
| 37016 | +function abortFetch (p, request, responseObject, error) { | |
| 37017 | + // Note: AbortSignal.reason was added in node v17.2.0 | |
| 37018 | + // which would give us an undefined error to reject with. | |
| 37019 | + // Remove this once node v16 is no longer supported. | |
| 37020 | + if (!error) { | |
| 37021 | + error = new DOMException('The operation was aborted.', 'AbortError') | |
| 37022 | + } | |
| 37023 | + | |
| 37024 | + // 1. Reject promise with error. | |
| 37025 | + p.reject(error) | |
| 37026 | + | |
| 37027 | + // 2. If request’s body is not null and is readable, then cancel request’s | |
| 37028 | + // body with error. | |
| 37029 | + if (request.body != null && isReadable(request.body?.stream)) { | |
| 37030 | + request.body.stream.cancel(error).catch((err) => { | |
| 37031 | + if (err.code === 'ERR_INVALID_STATE') { | |
| 37032 | + // Node bug? | |
| 37033 | + return | |
| 37034 | + } | |
| 37035 | + throw err | |
| 37036 | + }) | |
| 37037 | + } | |
| 37038 | + | |
| 37039 | + // 3. If responseObject is null, then return. | |
| 37040 | + if (responseObject == null) { | |
| 37041 | + return | |
| 37042 | + } | |
| 37043 | + | |
| 37044 | + // 4. Let response be responseObject’s response. | |
| 37045 | + const response = responseObject[kState] | |
| 37046 | + | |
| 37047 | + // 5. If response’s body is not null and is readable, then error response’s | |
| 37048 | + // body with error. | |
| 37049 | + if (response.body != null && isReadable(response.body?.stream)) { | |
| 37050 | + response.body.stream.cancel(error).catch((err) => { | |
| 37051 | + if (err.code === 'ERR_INVALID_STATE') { | |
| 37052 | + // Node bug? | |
| 37053 | + return | |
| 37054 | + } | |
| 37055 | + throw err | |
| 37056 | + }) | |
| 37057 | + } | |
| 37058 | +} | |
| 37059 | + | |
| 37060 | +// https://fetch.spec.whatwg.org/#fetching | |
| 37061 | +function fetching ({ | |
| 37062 | + request, | |
| 37063 | + processRequestBodyChunkLength, | |
| 37064 | + processRequestEndOfBody, | |
| 37065 | + processResponse, | |
| 37066 | + processResponseEndOfBody, | |
| 37067 | + processResponseConsumeBody, | |
| 37068 | + useParallelQueue = false, | |
| 37069 | + dispatcher // undici | |
| 37070 | +}) { | |
| 37071 | + // 1. Let taskDestination be null. | |
| 37072 | + let taskDestination = null | |
| 37073 | + | |
| 37074 | + // 2. Let crossOriginIsolatedCapability be false. | |
| 37075 | + let crossOriginIsolatedCapability = false | |
| 37076 | + | |
| 37077 | + // 3. If request’s client is non-null, then: | |
| 37078 | + if (request.client != null) { | |
| 37079 | + // 1. Set taskDestination to request’s client’s global object. | |
| 37080 | + taskDestination = request.client.globalObject | |
| 37081 | + | |
| 37082 | + // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin | |
| 37083 | + // isolated capability. | |
| 37084 | + crossOriginIsolatedCapability = | |
| 37085 | + request.client.crossOriginIsolatedCapability | |
| 37086 | + } | |
| 37087 | + | |
| 37088 | + // 4. If useParallelQueue is true, then set taskDestination to the result of | |
| 37089 | + // starting a new parallel queue. | |
| 37090 | + // TODO | |
| 37091 | + | |
| 37092 | + // 5. Let timingInfo be a new fetch timing info whose start time and | |
| 37093 | + // post-redirect start time are the coarsened shared current time given | |
| 37094 | + // crossOriginIsolatedCapability. | |
| 37095 | + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) | |
| 37096 | + const timingInfo = createOpaqueTimingInfo({ | |
| 37097 | + startTime: currenTime | |
| 37098 | + }) | |
| 37099 | + | |
| 37100 | + // 6. Let fetchParams be a new fetch params whose | |
| 37101 | + // request is request, | |
| 37102 | + // timing info is timingInfo, | |
| 37103 | + // process request body chunk length is processRequestBodyChunkLength, | |
| 37104 | + // process request end-of-body is processRequestEndOfBody, | |
| 37105 | + // process response is processResponse, | |
| 37106 | + // process response consume body is processResponseConsumeBody, | |
| 37107 | + // process response end-of-body is processResponseEndOfBody, | |
| 37108 | + // task destination is taskDestination, | |
| 37109 | + // and cross-origin isolated capability is crossOriginIsolatedCapability. | |
| 37110 | + const fetchParams = { | |
| 37111 | + controller: new Fetch(dispatcher), | |
| 37112 | + request, | |
| 37113 | + timingInfo, | |
| 37114 | + processRequestBodyChunkLength, | |
| 37115 | + processRequestEndOfBody, | |
| 37116 | + processResponse, | |
| 37117 | + processResponseConsumeBody, | |
| 37118 | + processResponseEndOfBody, | |
| 37119 | + taskDestination, | |
| 37120 | + crossOriginIsolatedCapability | |
| 37121 | + } | |
| 37122 | + | |
| 37123 | + // 7. If request’s body is a byte sequence, then set request’s body to | |
| 37124 | + // request’s body as a body. | |
| 37125 | + // NOTE: Since fetching is only called from fetch, body should already be | |
| 37126 | + // extracted. | |
| 37127 | + assert(!request.body || request.body.stream) | |
| 37128 | + | |
| 37129 | + // 8. If request’s window is "client", then set request’s window to request’s | |
| 37130 | + // client, if request’s client’s global object is a Window object; otherwise | |
| 37131 | + // "no-window". | |
| 37132 | + if (request.window === 'client') { | |
| 37133 | + // TODO: What if request.client is null? | |
| 37134 | + request.window = | |
| 37135 | + request.client?.globalObject?.constructor?.name === 'Window' | |
| 37136 | + ? request.client | |
| 37137 | + : 'no-window' | |
| 37138 | + } | |
| 37139 | + | |
| 37140 | + // 9. If request’s origin is "client", then set request’s origin to request’s | |
| 37141 | + // client’s origin. | |
| 37142 | + if (request.origin === 'client') { | |
| 37143 | + // TODO: What if request.client is null? | |
| 37144 | + request.origin = request.client?.origin | |
| 37145 | + } | |
| 37146 | + | |
| 37147 | + // 10. If all of the following conditions are true: | |
| 37148 | + // TODO | |
| 37149 | + | |
| 37150 | + // 11. If request’s policy container is "client", then: | |
| 37151 | + if (request.policyContainer === 'client') { | |
| 37152 | + // 1. If request’s client is non-null, then set request’s policy | |
| 37153 | + // container to a clone of request’s client’s policy container. [HTML] | |
| 37154 | + if (request.client != null) { | |
| 37155 | + request.policyContainer = clonePolicyContainer( | |
| 37156 | + request.client.policyContainer | |
| 37157 | + ) | |
| 37158 | + } else { | |
| 37159 | + // 2. Otherwise, set request’s policy container to a new policy | |
| 37160 | + // container. | |
| 37161 | + request.policyContainer = makePolicyContainer() | |
| 37162 | + } | |
| 37163 | + } | |
| 37164 | + | |
| 37165 | + // 12. If request’s header list does not contain `Accept`, then: | |
| 37166 | + if (!request.headersList.contains('accept')) { | |
| 37167 | + // 1. Let value be `*/*`. | |
| 37168 | + const value = '*/*' | |
| 37169 | + | |
| 37170 | + // 2. A user agent should set value to the first matching statement, if | |
| 37171 | + // any, switching on request’s destination: | |
| 37172 | + // "document" | |
| 37173 | + // "frame" | |
| 37174 | + // "iframe" | |
| 37175 | + // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` | |
| 37176 | + // "image" | |
| 37177 | + // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` | |
| 37178 | + // "style" | |
| 37179 | + // `text/css,*/*;q=0.1` | |
| 37180 | + // TODO | |
| 37181 | + | |
| 37182 | + // 3. Append `Accept`/value to request’s header list. | |
| 37183 | + request.headersList.append('accept', value) | |
| 37184 | + } | |
| 37185 | + | |
| 37186 | + // 13. If request’s header list does not contain `Accept-Language`, then | |
| 37187 | + // user agents should append `Accept-Language`/an appropriate value to | |
| 37188 | + // request’s header list. | |
| 37189 | + if (!request.headersList.contains('accept-language')) { | |
| 37190 | + request.headersList.append('accept-language', '*') | |
| 37191 | + } | |
| 37192 | + | |
| 37193 | + // 14. If request’s priority is null, then use request’s initiator and | |
| 37194 | + // destination appropriately in setting request’s priority to a | |
| 37195 | + // user-agent-defined object. | |
| 37196 | + if (request.priority === null) { | |
| 37197 | + // TODO | |
| 37198 | + } | |
| 37199 | + | |
| 37200 | + // 15. If request is a subresource request, then: | |
| 37201 | + if (subresourceSet.has(request.destination)) { | |
| 37202 | + // TODO | |
| 37203 | + } | |
| 37204 | + | |
| 37205 | + // 16. Run main fetch given fetchParams. | |
| 37206 | + mainFetch(fetchParams) | |
| 37207 | + .catch(err => { | |
| 37208 | + fetchParams.controller.terminate(err) | |
| 37209 | + }) | |
| 37210 | + | |
| 37211 | + // 17. Return fetchParam's controller | |
| 37212 | + return fetchParams.controller | |
| 37213 | +} | |
| 37214 | + | |
| 37215 | +// https://fetch.spec.whatwg.org/#concept-main-fetch | |
| 37216 | +async function mainFetch (fetchParams, recursive = false) { | |
| 37217 | + // 1. Let request be fetchParams’s request. | |
| 37218 | + const request = fetchParams.request | |
| 37219 | + | |
| 37220 | + // 2. Let response be null. | |
| 37221 | + let response = null | |
| 37222 | + | |
| 37223 | + // 3. If request’s local-URLs-only flag is set and request’s current URL is | |
| 37224 | + // not local, then set response to a network error. | |
| 37225 | + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { | |
| 37226 | + response = makeNetworkError('local URLs only') | |
| 37227 | + } | |
| 37228 | + | |
| 37229 | + // 4. Run report Content Security Policy violations for request. | |
| 37230 | + // TODO | |
| 37231 | + | |
| 37232 | + // 5. Upgrade request to a potentially trustworthy URL, if appropriate. | |
| 37233 | + tryUpgradeRequestToAPotentiallyTrustworthyURL(request) | |
| 37234 | + | |
| 37235 | + // 6. If should request be blocked due to a bad port, should fetching request | |
| 37236 | + // be blocked as mixed content, or should request be blocked by Content | |
| 37237 | + // Security Policy returns blocked, then set response to a network error. | |
| 37238 | + if (requestBadPort(request) === 'blocked') { | |
| 37239 | + response = makeNetworkError('bad port') | |
| 37240 | + } | |
| 37241 | + // TODO: should fetching request be blocked as mixed content? | |
| 37242 | + // TODO: should request be blocked by Content Security Policy? | |
| 37243 | + | |
| 37244 | + // 7. If request’s referrer policy is the empty string, then set request’s | |
| 37245 | + // referrer policy to request’s policy container’s referrer policy. | |
| 37246 | + if (request.referrerPolicy === '') { | |
| 37247 | + request.referrerPolicy = request.policyContainer.referrerPolicy | |
| 37248 | + } | |
| 37249 | + | |
| 37250 | + // 8. If request’s referrer is not "no-referrer", then set request’s | |
| 37251 | + // referrer to the result of invoking determine request’s referrer. | |
| 37252 | + if (request.referrer !== 'no-referrer') { | |
| 37253 | + request.referrer = determineRequestsReferrer(request) | |
| 37254 | + } | |
| 37255 | + | |
| 37256 | + // 9. Set request’s current URL’s scheme to "https" if all of the following | |
| 37257 | + // conditions are true: | |
| 37258 | + // - request’s current URL’s scheme is "http" | |
| 37259 | + // - request’s current URL’s host is a domain | |
| 37260 | + // - Matching request’s current URL’s host per Known HSTS Host Domain Name | |
| 37261 | + // Matching results in either a superdomain match with an asserted | |
| 37262 | + // includeSubDomains directive or a congruent match (with or without an | |
| 37263 | + // asserted includeSubDomains directive). [HSTS] | |
| 37264 | + // TODO | |
| 37265 | + | |
| 37266 | + // 10. If recursive is false, then run the remaining steps in parallel. | |
| 37267 | + // TODO | |
| 37268 | + | |
| 37269 | + // 11. If response is null, then set response to the result of running | |
| 37270 | + // the steps corresponding to the first matching statement: | |
| 37271 | + if (response === null) { | |
| 37272 | + response = await (async () => { | |
| 37273 | + const currentURL = requestCurrentURL(request) | |
| 37274 | + | |
| 37275 | + if ( | |
| 37276 | + // - request’s current URL’s origin is same origin with request’s origin, | |
| 37277 | + // and request’s response tainting is "basic" | |
| 37278 | + (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || | |
| 37279 | + // request’s current URL’s scheme is "data" | |
| 37280 | + (currentURL.protocol === 'data:') || | |
| 37281 | + // - request’s mode is "navigate" or "websocket" | |
| 37282 | + (request.mode === 'navigate' || request.mode === 'websocket') | |
| 37283 | + ) { | |
| 37284 | + // 1. Set request’s response tainting to "basic". | |
| 37285 | + request.responseTainting = 'basic' | |
| 37286 | + | |
| 37287 | + // 2. Return the result of running scheme fetch given fetchParams. | |
| 37288 | + return await schemeFetch(fetchParams) | |
| 37289 | + } | |
| 37290 | + | |
| 37291 | + // request’s mode is "same-origin" | |
| 37292 | + if (request.mode === 'same-origin') { | |
| 37293 | + // 1. Return a network error. | |
| 37294 | + return makeNetworkError('request mode cannot be "same-origin"') | |
| 37295 | + } | |
| 37296 | + | |
| 37297 | + // request’s mode is "no-cors" | |
| 37298 | + if (request.mode === 'no-cors') { | |
| 37299 | + // 1. If request’s redirect mode is not "follow", then return a network | |
| 37300 | + // error. | |
| 37301 | + if (request.redirect !== 'follow') { | |
| 37302 | + return makeNetworkError( | |
| 37303 | + 'redirect mode cannot be "follow" for "no-cors" request' | |
| 37304 | + ) | |
| 37305 | + } | |
| 37306 | + | |
| 37307 | + // 2. Set request’s response tainting to "opaque". | |
| 37308 | + request.responseTainting = 'opaque' | |
| 37309 | + | |
| 37310 | + // 3. Return the result of running scheme fetch given fetchParams. | |
| 37311 | + return await schemeFetch(fetchParams) | |
| 37312 | + } | |
| 37313 | + | |
| 37314 | + // request’s current URL’s scheme is not an HTTP(S) scheme | |
| 37315 | + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { | |
| 37316 | + // Return a network error. | |
| 37317 | + return makeNetworkError('URL scheme must be a HTTP(S) scheme') | |
| 37318 | + } | |
| 37319 | + | |
| 37320 | + // - request’s use-CORS-preflight flag is set | |
| 37321 | + // - request’s unsafe-request flag is set and either request’s method is | |
| 37322 | + // not a CORS-safelisted method or CORS-unsafe request-header names with | |
| 37323 | + // request’s header list is not empty | |
| 37324 | + // 1. Set request’s response tainting to "cors". | |
| 37325 | + // 2. Let corsWithPreflightResponse be the result of running HTTP fetch | |
| 37326 | + // given fetchParams and true. | |
| 37327 | + // 3. If corsWithPreflightResponse is a network error, then clear cache | |
| 37328 | + // entries using request. | |
| 37329 | + // 4. Return corsWithPreflightResponse. | |
| 37330 | + // TODO | |
| 37331 | + | |
| 37332 | + // Otherwise | |
| 37333 | + // 1. Set request’s response tainting to "cors". | |
| 37334 | + request.responseTainting = 'cors' | |
| 37335 | + | |
| 37336 | + // 2. Return the result of running HTTP fetch given fetchParams. | |
| 37337 | + return await httpFetch(fetchParams) | |
| 37338 | + })() | |
| 37339 | + } | |
| 37340 | + | |
| 37341 | + // 12. If recursive is true, then return response. | |
| 37342 | + if (recursive) { | |
| 37343 | + return response | |
| 37344 | + } | |
| 37345 | + | |
| 37346 | + // 13. If response is not a network error and response is not a filtered | |
| 37347 | + // response, then: | |
| 37348 | + if (response.status !== 0 && !response.internalResponse) { | |
| 37349 | + // If request’s response tainting is "cors", then: | |
| 37350 | + if (request.responseTainting === 'cors') { | |
| 37351 | + // 1. Let headerNames be the result of extracting header list values | |
| 37352 | + // given `Access-Control-Expose-Headers` and response’s header list. | |
| 37353 | + // TODO | |
| 37354 | + // 2. If request’s credentials mode is not "include" and headerNames | |
| 37355 | + // contains `*`, then set response’s CORS-exposed header-name list to | |
| 37356 | + // all unique header names in response’s header list. | |
| 37357 | + // TODO | |
| 37358 | + // 3. Otherwise, if headerNames is not null or failure, then set | |
| 37359 | + // response’s CORS-exposed header-name list to headerNames. | |
| 37360 | + // TODO | |
| 37361 | + } | |
| 37362 | + | |
| 37363 | + // Set response to the following filtered response with response as its | |
| 37364 | + // internal response, depending on request’s response tainting: | |
| 37365 | + if (request.responseTainting === 'basic') { | |
| 37366 | + response = filterResponse(response, 'basic') | |
| 37367 | + } else if (request.responseTainting === 'cors') { | |
| 37368 | + response = filterResponse(response, 'cors') | |
| 37369 | + } else if (request.responseTainting === 'opaque') { | |
| 37370 | + response = filterResponse(response, 'opaque') | |
| 37371 | + } else { | |
| 37372 | + assert(false) | |
| 37373 | + } | |
| 37374 | + } | |
| 37375 | + | |
| 37376 | + // 14. Let internalResponse be response, if response is a network error, | |
| 37377 | + // and response’s internal response otherwise. | |
| 37378 | + let internalResponse = | |
| 37379 | + response.status === 0 ? response : response.internalResponse | |
| 37380 | + | |
| 37381 | + // 15. If internalResponse’s URL list is empty, then set it to a clone of | |
| 37382 | + // request’s URL list. | |
| 37383 | + if (internalResponse.urlList.length === 0) { | |
| 37384 | + internalResponse.urlList.push(...request.urlList) | |
| 37385 | + } | |
| 37386 | + | |
| 37387 | + // 16. If request’s timing allow failed flag is unset, then set | |
| 37388 | + // internalResponse’s timing allow passed flag. | |
| 37389 | + if (!request.timingAllowFailed) { | |
| 37390 | + response.timingAllowPassed = true | |
| 37391 | + } | |
| 37392 | + | |
| 37393 | + // 17. If response is not a network error and any of the following returns | |
| 37394 | + // blocked | |
| 37395 | + // - should internalResponse to request be blocked as mixed content | |
| 37396 | + // - should internalResponse to request be blocked by Content Security Policy | |
| 37397 | + // - should internalResponse to request be blocked due to its MIME type | |
| 37398 | + // - should internalResponse to request be blocked due to nosniff | |
| 37399 | + // TODO | |
| 37400 | + | |
| 37401 | + // 18. If response’s type is "opaque", internalResponse’s status is 206, | |
| 37402 | + // internalResponse’s range-requested flag is set, and request’s header | |
| 37403 | + // list does not contain `Range`, then set response and internalResponse | |
| 37404 | + // to a network error. | |
| 37405 | + if ( | |
| 37406 | + response.type === 'opaque' && | |
| 37407 | + internalResponse.status === 206 && | |
| 37408 | + internalResponse.rangeRequested && | |
| 37409 | + !request.headers.contains('range') | |
| 37410 | + ) { | |
| 37411 | + response = internalResponse = makeNetworkError() | |
| 37412 | + } | |
| 37413 | + | |
| 37414 | + // 19. If response is not a network error and either request’s method is | |
| 37415 | + // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, | |
| 37416 | + // set internalResponse’s body to null and disregard any enqueuing toward | |
| 37417 | + // it (if any). | |
| 37418 | + if ( | |
| 37419 | + response.status !== 0 && | |
| 37420 | + (request.method === 'HEAD' || | |
| 37421 | + request.method === 'CONNECT' || | |
| 37422 | + nullBodyStatus.includes(internalResponse.status)) | |
| 37423 | + ) { | |
| 37424 | + internalResponse.body = null | |
| 37425 | + fetchParams.controller.dump = true | |
| 37426 | + } | |
| 37427 | + | |
| 37428 | + // 20. If request’s integrity metadata is not the empty string, then: | |
| 37429 | + if (request.integrity) { | |
| 37430 | + // 1. Let processBodyError be this step: run fetch finale given fetchParams | |
| 37431 | + // and a network error. | |
| 37432 | + const processBodyError = (reason) => | |
| 37433 | + fetchFinale(fetchParams, makeNetworkError(reason)) | |
| 37434 | + | |
| 37435 | + // 2. If request’s response tainting is "opaque", or response’s body is null, | |
| 37436 | + // then run processBodyError and abort these steps. | |
| 37437 | + if (request.responseTainting === 'opaque' || response.body == null) { | |
| 37438 | + processBodyError(response.error) | |
| 37439 | + return | |
| 37440 | + } | |
| 37441 | + | |
| 37442 | + // 3. Let processBody given bytes be these steps: | |
| 37443 | + const processBody = (bytes) => { | |
| 37444 | + // 1. If bytes do not match request’s integrity metadata, | |
| 37445 | + // then run processBodyError and abort these steps. [SRI] | |
| 37446 | + if (!bytesMatch(bytes, request.integrity)) { | |
| 37447 | + processBodyError('integrity mismatch') | |
| 37448 | + return | |
| 37449 | + } | |
| 37450 | + | |
| 37451 | + // 2. Set response’s body to bytes as a body. | |
| 37452 | + response.body = safelyExtractBody(bytes)[0] | |
| 37453 | + | |
| 37454 | + // 3. Run fetch finale given fetchParams and response. | |
| 37455 | + fetchFinale(fetchParams, response) | |
| 37456 | + } | |
| 37457 | + | |
| 37458 | + // 4. Fully read response’s body given processBody and processBodyError. | |
| 37459 | + await fullyReadBody(response.body, processBody, processBodyError) | |
| 37460 | + } else { | |
| 37461 | + // 21. Otherwise, run fetch finale given fetchParams and response. | |
| 37462 | + fetchFinale(fetchParams, response) | |
| 37463 | + } | |
| 37464 | +} | |
| 37465 | + | |
| 37466 | +// https://fetch.spec.whatwg.org/#concept-scheme-fetch | |
| 37467 | +// given a fetch params fetchParams | |
| 37468 | +function schemeFetch (fetchParams) { | |
| 37469 | + // Note: since the connection is destroyed on redirect, which sets fetchParams to a | |
| 37470 | + // cancelled state, we do not want this condition to trigger *unless* there have been | |
| 37471 | + // no redirects. See https://github.com/nodejs/undici/issues/1776 | |
| 37472 | + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. | |
| 37473 | + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { | |
| 37474 | + return Promise.resolve(makeAppropriateNetworkError(fetchParams)) | |
| 37475 | + } | |
| 37476 | + | |
| 37477 | + // 2. Let request be fetchParams’s request. | |
| 37478 | + const { request } = fetchParams | |
| 37479 | + | |
| 37480 | + const { protocol: scheme } = requestCurrentURL(request) | |
| 37481 | + | |
| 37482 | + // 3. Switch on request’s current URL’s scheme and run the associated steps: | |
| 37483 | + switch (scheme) { | |
| 37484 | + case 'about:': { | |
| 37485 | + // If request’s current URL’s path is the string "blank", then return a new response | |
| 37486 | + // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », | |
| 37487 | + // and body is the empty byte sequence as a body. | |
| 37488 | + | |
| 37489 | + // Otherwise, return a network error. | |
| 37490 | + return Promise.resolve(makeNetworkError('about scheme is not supported')) | |
| 37491 | + } | |
| 37492 | + case 'blob:': { | |
| 37493 | + if (!resolveObjectURL) { | |
| 37494 | + resolveObjectURL = (__nccwpck_require__(181).resolveObjectURL) | |
| 37495 | + } | |
| 37496 | + | |
| 37497 | + // 1. Let blobURLEntry be request’s current URL’s blob URL entry. | |
| 37498 | + const blobURLEntry = requestCurrentURL(request) | |
| 37499 | + | |
| 37500 | + // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 | |
| 37501 | + // Buffer.resolveObjectURL does not ignore URL queries. | |
| 37502 | + if (blobURLEntry.search.length !== 0) { | |
| 37503 | + return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) | |
| 37504 | + } | |
| 37505 | + | |
| 37506 | + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) | |
| 37507 | + | |
| 37508 | + // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s | |
| 37509 | + // object is not a Blob object, then return a network error. | |
| 37510 | + if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { | |
| 37511 | + return Promise.resolve(makeNetworkError('invalid method')) | |
| 37512 | + } | |
| 37513 | + | |
| 37514 | + // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. | |
| 37515 | + const bodyWithType = safelyExtractBody(blobURLEntryObject) | |
| 37516 | + | |
| 37517 | + // 4. Let body be bodyWithType’s body. | |
| 37518 | + const body = bodyWithType[0] | |
| 37519 | + | |
| 37520 | + // 5. Let length be body’s length, serialized and isomorphic encoded. | |
| 37521 | + const length = isomorphicEncode(`${body.length}`) | |
| 37522 | + | |
| 37523 | + // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. | |
| 37524 | + const type = bodyWithType[1] ?? '' | |
| 37525 | + | |
| 37526 | + // 7. Return a new response whose status message is `OK`, header list is | |
| 37527 | + // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. | |
| 37528 | + const response = makeResponse({ | |
| 37529 | + statusText: 'OK', | |
| 37530 | + headersList: [ | |
| 37531 | + ['content-length', { name: 'Content-Length', value: length }], | |
| 37532 | + ['content-type', { name: 'Content-Type', value: type }] | |
| 37533 | + ] | |
| 37534 | + }) | |
| 37535 | + | |
| 37536 | + response.body = body | |
| 37537 | + | |
| 37538 | + return Promise.resolve(response) | |
| 37539 | + } | |
| 37540 | + case 'data:': { | |
| 37541 | + // 1. Let dataURLStruct be the result of running the | |
| 37542 | + // data: URL processor on request’s current URL. | |
| 37543 | + const currentURL = requestCurrentURL(request) | |
| 37544 | + const dataURLStruct = dataURLProcessor(currentURL) | |
| 37545 | + | |
| 37546 | + // 2. If dataURLStruct is failure, then return a | |
| 37547 | + // network error. | |
| 37548 | + if (dataURLStruct === 'failure') { | |
| 37549 | + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) | |
| 37550 | + } | |
| 37551 | + | |
| 37552 | + // 3. Let mimeType be dataURLStruct’s MIME type, serialized. | |
| 37553 | + const mimeType = serializeAMimeType(dataURLStruct.mimeType) | |
| 37554 | + | |
| 37555 | + // 4. Return a response whose status message is `OK`, | |
| 37556 | + // header list is « (`Content-Type`, mimeType) », | |
| 37557 | + // and body is dataURLStruct’s body as a body. | |
| 37558 | + return Promise.resolve(makeResponse({ | |
| 37559 | + statusText: 'OK', | |
| 37560 | + headersList: [ | |
| 37561 | + ['content-type', { name: 'Content-Type', value: mimeType }] | |
| 37562 | + ], | |
| 37563 | + body: safelyExtractBody(dataURLStruct.body)[0] | |
| 37564 | + })) | |
| 37565 | + } | |
| 37566 | + case 'file:': { | |
| 37567 | + // For now, unfortunate as it is, file URLs are left as an exercise for the reader. | |
| 37568 | + // When in doubt, return a network error. | |
| 37569 | + return Promise.resolve(makeNetworkError('not implemented... yet...')) | |
| 37570 | + } | |
| 37571 | + case 'http:': | |
| 37572 | + case 'https:': { | |
| 37573 | + // Return the result of running HTTP fetch given fetchParams. | |
| 37574 | + | |
| 37575 | + return httpFetch(fetchParams) | |
| 37576 | + .catch((err) => makeNetworkError(err)) | |
| 37577 | + } | |
| 37578 | + default: { | |
| 37579 | + return Promise.resolve(makeNetworkError('unknown scheme')) | |
| 37580 | + } | |
| 37581 | + } | |
| 37582 | +} | |
| 37583 | + | |
| 37584 | +// https://fetch.spec.whatwg.org/#finalize-response | |
| 37585 | +function finalizeResponse (fetchParams, response) { | |
| 37586 | + // 1. Set fetchParams’s request’s done flag. | |
| 37587 | + fetchParams.request.done = true | |
| 37588 | + | |
| 37589 | + // 2, If fetchParams’s process response done is not null, then queue a fetch | |
| 37590 | + // task to run fetchParams’s process response done given response, with | |
| 37591 | + // fetchParams’s task destination. | |
| 37592 | + if (fetchParams.processResponseDone != null) { | |
| 37593 | + queueMicrotask(() => fetchParams.processResponseDone(response)) | |
| 37594 | + } | |
| 37595 | +} | |
| 37596 | + | |
| 37597 | +// https://fetch.spec.whatwg.org/#fetch-finale | |
| 37598 | +function fetchFinale (fetchParams, response) { | |
| 37599 | + // 1. If response is a network error, then: | |
| 37600 | + if (response.type === 'error') { | |
| 37601 | + // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». | |
| 37602 | + response.urlList = [fetchParams.request.urlList[0]] | |
| 37603 | + | |
| 37604 | + // 2. Set response’s timing info to the result of creating an opaque timing | |
| 37605 | + // info for fetchParams’s timing info. | |
| 37606 | + response.timingInfo = createOpaqueTimingInfo({ | |
| 37607 | + startTime: fetchParams.timingInfo.startTime | |
| 37608 | + }) | |
| 37609 | + } | |
| 37610 | + | |
| 37611 | + // 2. Let processResponseEndOfBody be the following steps: | |
| 37612 | + const processResponseEndOfBody = () => { | |
| 37613 | + // 1. Set fetchParams’s request’s done flag. | |
| 37614 | + fetchParams.request.done = true | |
| 37615 | + | |
| 37616 | + // If fetchParams’s process response end-of-body is not null, | |
| 37617 | + // then queue a fetch task to run fetchParams’s process response | |
| 37618 | + // end-of-body given response with fetchParams’s task destination. | |
| 37619 | + if (fetchParams.processResponseEndOfBody != null) { | |
| 37620 | + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) | |
| 37621 | + } | |
| 37622 | + } | |
| 37623 | + | |
| 37624 | + // 3. If fetchParams’s process response is non-null, then queue a fetch task | |
| 37625 | + // to run fetchParams’s process response given response, with fetchParams’s | |
| 37626 | + // task destination. | |
| 37627 | + if (fetchParams.processResponse != null) { | |
| 37628 | + queueMicrotask(() => fetchParams.processResponse(response)) | |
| 37629 | + } | |
| 37630 | + | |
| 37631 | + // 4. If response’s body is null, then run processResponseEndOfBody. | |
| 37632 | + if (response.body == null) { | |
| 37633 | + processResponseEndOfBody() | |
| 37634 | + } else { | |
| 37635 | + // 5. Otherwise: | |
| 37636 | + | |
| 37637 | + // 1. Let transformStream be a new a TransformStream. | |
| 37638 | + | |
| 37639 | + // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, | |
| 37640 | + // enqueues chunk in transformStream. | |
| 37641 | + const identityTransformAlgorithm = (chunk, controller) => { | |
| 37642 | + controller.enqueue(chunk) | |
| 37643 | + } | |
| 37644 | + | |
| 37645 | + // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm | |
| 37646 | + // and flushAlgorithm set to processResponseEndOfBody. | |
| 37647 | + const transformStream = new TransformStream({ | |
| 37648 | + start () {}, | |
| 37649 | + transform: identityTransformAlgorithm, | |
| 37650 | + flush: processResponseEndOfBody | |
| 37651 | + }, { | |
| 37652 | + size () { | |
| 37653 | + return 1 | |
| 37654 | + } | |
| 37655 | + }, { | |
| 37656 | + size () { | |
| 37657 | + return 1 | |
| 37658 | + } | |
| 37659 | + }) | |
| 37660 | + | |
| 37661 | + // 4. Set response’s body to the result of piping response’s body through transformStream. | |
| 37662 | + response.body = { stream: response.body.stream.pipeThrough(transformStream) } | |
| 37663 | + } | |
| 37664 | + | |
| 37665 | + // 6. If fetchParams’s process response consume body is non-null, then: | |
| 37666 | + if (fetchParams.processResponseConsumeBody != null) { | |
| 37667 | + // 1. Let processBody given nullOrBytes be this step: run fetchParams’s | |
| 37668 | + // process response consume body given response and nullOrBytes. | |
| 37669 | + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) | |
| 37670 | + | |
| 37671 | + // 2. Let processBodyError be this step: run fetchParams’s process | |
| 37672 | + // response consume body given response and failure. | |
| 37673 | + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) | |
| 37674 | + | |
| 37675 | + // 3. If response’s body is null, then queue a fetch task to run processBody | |
| 37676 | + // given null, with fetchParams’s task destination. | |
| 37677 | + if (response.body == null) { | |
| 37678 | + queueMicrotask(() => processBody(null)) | |
| 37679 | + } else { | |
| 37680 | + // 4. Otherwise, fully read response’s body given processBody, processBodyError, | |
| 37681 | + // and fetchParams’s task destination. | |
| 37682 | + return fullyReadBody(response.body, processBody, processBodyError) | |
| 37683 | + } | |
| 37684 | + return Promise.resolve() | |
| 37685 | + } | |
| 37686 | +} | |
| 37687 | + | |
| 37688 | +// https://fetch.spec.whatwg.org/#http-fetch | |
| 37689 | +async function httpFetch (fetchParams) { | |
| 37690 | + // 1. Let request be fetchParams’s request. | |
| 37691 | + const request = fetchParams.request | |
| 37692 | + | |
| 37693 | + // 2. Let response be null. | |
| 37694 | + let response = null | |
| 37695 | + | |
| 37696 | + // 3. Let actualResponse be null. | |
| 37697 | + let actualResponse = null | |
| 37698 | + | |
| 37699 | + // 4. Let timingInfo be fetchParams’s timing info. | |
| 37700 | + const timingInfo = fetchParams.timingInfo | |
| 37701 | + | |
| 37702 | + // 5. If request’s service-workers mode is "all", then: | |
| 37703 | + if (request.serviceWorkers === 'all') { | |
| 37704 | + // TODO | |
| 37705 | + } | |
| 37706 | + | |
| 37707 | + // 6. If response is null, then: | |
| 37708 | + if (response === null) { | |
| 37709 | + // 1. If makeCORSPreflight is true and one of these conditions is true: | |
| 37710 | + // TODO | |
| 37711 | + | |
| 37712 | + // 2. If request’s redirect mode is "follow", then set request’s | |
| 37713 | + // service-workers mode to "none". | |
| 37714 | + if (request.redirect === 'follow') { | |
| 37715 | + request.serviceWorkers = 'none' | |
| 37716 | + } | |
| 37717 | + | |
| 37718 | + // 3. Set response and actualResponse to the result of running | |
| 37719 | + // HTTP-network-or-cache fetch given fetchParams. | |
| 37720 | + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) | |
| 37721 | + | |
| 37722 | + // 4. If request’s response tainting is "cors" and a CORS check | |
| 37723 | + // for request and response returns failure, then return a network error. | |
| 37724 | + if ( | |
| 37725 | + request.responseTainting === 'cors' && | |
| 37726 | + corsCheck(request, response) === 'failure' | |
| 37727 | + ) { | |
| 37728 | + return makeNetworkError('cors failure') | |
| 37729 | + } | |
| 37730 | + | |
| 37731 | + // 5. If the TAO check for request and response returns failure, then set | |
| 37732 | + // request’s timing allow failed flag. | |
| 37733 | + if (TAOCheck(request, response) === 'failure') { | |
| 37734 | + request.timingAllowFailed = true | |
| 37735 | + } | |
| 37736 | + } | |
| 37737 | + | |
| 37738 | + // 7. If either request’s response tainting or response’s type | |
| 37739 | + // is "opaque", and the cross-origin resource policy check with | |
| 37740 | + // request’s origin, request’s client, request’s destination, | |
| 37741 | + // and actualResponse returns blocked, then return a network error. | |
| 37742 | + if ( | |
| 37743 | + (request.responseTainting === 'opaque' || response.type === 'opaque') && | |
| 37744 | + crossOriginResourcePolicyCheck( | |
| 37745 | + request.origin, | |
| 37746 | + request.client, | |
| 37747 | + request.destination, | |
| 37748 | + actualResponse | |
| 37749 | + ) === 'blocked' | |
| 37750 | + ) { | |
| 37751 | + return makeNetworkError('blocked') | |
| 37752 | + } | |
| 37753 | + | |
| 37754 | + // 8. If actualResponse’s status is a redirect status, then: | |
| 37755 | + if (redirectStatusSet.has(actualResponse.status)) { | |
| 37756 | + // 1. If actualResponse’s status is not 303, request’s body is not null, | |
| 37757 | + // and the connection uses HTTP/2, then user agents may, and are even | |
| 37758 | + // encouraged to, transmit an RST_STREAM frame. | |
| 37759 | + // See, https://github.com/whatwg/fetch/issues/1288 | |
| 37760 | + if (request.redirect !== 'manual') { | |
| 37761 | + fetchParams.controller.connection.destroy() | |
| 37762 | + } | |
| 37763 | + | |
| 37764 | + // 2. Switch on request’s redirect mode: | |
| 37765 | + if (request.redirect === 'error') { | |
| 37766 | + // Set response to a network error. | |
| 37767 | + response = makeNetworkError('unexpected redirect') | |
| 37768 | + } else if (request.redirect === 'manual') { | |
| 37769 | + // Set response to an opaque-redirect filtered response whose internal | |
| 37770 | + // response is actualResponse. | |
| 37771 | + // NOTE(spec): On the web this would return an `opaqueredirect` response, | |
| 37772 | + // but that doesn't make sense server side. | |
| 37773 | + // See https://github.com/nodejs/undici/issues/1193. | |
| 37774 | + response = actualResponse | |
| 37775 | + } else if (request.redirect === 'follow') { | |
| 37776 | + // Set response to the result of running HTTP-redirect fetch given | |
| 37777 | + // fetchParams and response. | |
| 37778 | + response = await httpRedirectFetch(fetchParams, response) | |
| 37779 | + } else { | |
| 37780 | + assert(false) | |
| 37781 | + } | |
| 37782 | + } | |
| 37783 | + | |
| 37784 | + // 9. Set response’s timing info to timingInfo. | |
| 37785 | + response.timingInfo = timingInfo | |
| 37786 | + | |
| 37787 | + // 10. Return response. | |
| 37788 | + return response | |
| 37789 | +} | |
| 37790 | + | |
| 37791 | +// https://fetch.spec.whatwg.org/#http-redirect-fetch | |
| 37792 | +function httpRedirectFetch (fetchParams, response) { | |
| 37793 | + // 1. Let request be fetchParams’s request. | |
| 37794 | + const request = fetchParams.request | |
| 37795 | + | |
| 37796 | + // 2. Let actualResponse be response, if response is not a filtered response, | |
| 37797 | + // and response’s internal response otherwise. | |
| 37798 | + const actualResponse = response.internalResponse | |
| 37799 | + ? response.internalResponse | |
| 37800 | + : response | |
| 37801 | + | |
| 37802 | + // 3. Let locationURL be actualResponse’s location URL given request’s current | |
| 37803 | + // URL’s fragment. | |
| 37804 | + let locationURL | |
| 37805 | + | |
| 37806 | + try { | |
| 37807 | + locationURL = responseLocationURL( | |
| 37808 | + actualResponse, | |
| 37809 | + requestCurrentURL(request).hash | |
| 37810 | + ) | |
| 37811 | + | |
| 37812 | + // 4. If locationURL is null, then return response. | |
| 37813 | + if (locationURL == null) { | |
| 37814 | + return response | |
| 37815 | + } | |
| 37816 | + } catch (err) { | |
| 37817 | + // 5. If locationURL is failure, then return a network error. | |
| 37818 | + return Promise.resolve(makeNetworkError(err)) | |
| 37819 | + } | |
| 37820 | + | |
| 37821 | + // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network | |
| 37822 | + // error. | |
| 37823 | + if (!urlIsHttpHttpsScheme(locationURL)) { | |
| 37824 | + return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) | |
| 37825 | + } | |
| 37826 | + | |
| 37827 | + // 7. If request’s redirect count is 20, then return a network error. | |
| 37828 | + if (request.redirectCount === 20) { | |
| 37829 | + return Promise.resolve(makeNetworkError('redirect count exceeded')) | |
| 37830 | + } | |
| 37831 | + | |
| 37832 | + // 8. Increase request’s redirect count by 1. | |
| 37833 | + request.redirectCount += 1 | |
| 37834 | + | |
| 37835 | + // 9. If request’s mode is "cors", locationURL includes credentials, and | |
| 37836 | + // request’s origin is not same origin with locationURL’s origin, then return | |
| 37837 | + // a network error. | |
| 37838 | + if ( | |
| 37839 | + request.mode === 'cors' && | |
| 37840 | + (locationURL.username || locationURL.password) && | |
| 37841 | + !sameOrigin(request, locationURL) | |
| 37842 | + ) { | |
| 37843 | + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) | |
| 37844 | + } | |
| 37845 | + | |
| 37846 | + // 10. If request’s response tainting is "cors" and locationURL includes | |
| 37847 | + // credentials, then return a network error. | |
| 37848 | + if ( | |
| 37849 | + request.responseTainting === 'cors' && | |
| 37850 | + (locationURL.username || locationURL.password) | |
| 37851 | + ) { | |
| 37852 | + return Promise.resolve(makeNetworkError( | |
| 37853 | + 'URL cannot contain credentials for request mode "cors"' | |
| 37854 | + )) | |
| 37855 | + } | |
| 37856 | + | |
| 37857 | + // 11. If actualResponse’s status is not 303, request’s body is non-null, | |
| 37858 | + // and request’s body’s source is null, then return a network error. | |
| 37859 | + if ( | |
| 37860 | + actualResponse.status !== 303 && | |
| 37861 | + request.body != null && | |
| 37862 | + request.body.source == null | |
| 37863 | + ) { | |
| 37864 | + return Promise.resolve(makeNetworkError()) | |
| 37865 | + } | |
| 37866 | + | |
| 37867 | + // 12. If one of the following is true | |
| 37868 | + // - actualResponse’s status is 301 or 302 and request’s method is `POST` | |
| 37869 | + // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` | |
| 37870 | + if ( | |
| 37871 | + ([301, 302].includes(actualResponse.status) && request.method === 'POST') || | |
| 37872 | + (actualResponse.status === 303 && | |
| 37873 | + !GET_OR_HEAD.includes(request.method)) | |
| 37874 | + ) { | |
| 37875 | + // then: | |
| 37876 | + // 1. Set request’s method to `GET` and request’s body to null. | |
| 37877 | + request.method = 'GET' | |
| 37878 | + request.body = null | |
| 37879 | + | |
| 37880 | + // 2. For each headerName of request-body-header name, delete headerName from | |
| 37881 | + // request’s header list. | |
| 37882 | + for (const headerName of requestBodyHeader) { | |
| 37883 | + request.headersList.delete(headerName) | |
| 37884 | + } | |
| 37885 | + } | |
| 37886 | + | |
| 37887 | + // 13. If request’s current URL’s origin is not same origin with locationURL’s | |
| 37888 | + // origin, then for each headerName of CORS non-wildcard request-header name, | |
| 37889 | + // delete headerName from request’s header list. | |
| 37890 | + if (!sameOrigin(requestCurrentURL(request), locationURL)) { | |
| 37891 | + // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name | |
| 37892 | + request.headersList.delete('authorization') | |
| 37893 | + | |
| 37894 | + // https://fetch.spec.whatwg.org/#authentication-entries | |
| 37895 | + request.headersList.delete('proxy-authorization', true) | |
| 37896 | + | |
| 37897 | + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. | |
| 37898 | + request.headersList.delete('cookie') | |
| 37899 | + request.headersList.delete('host') | |
| 37900 | + } | |
| 37901 | + | |
| 37902 | + // 14. If request’s body is non-null, then set request’s body to the first return | |
| 37903 | + // value of safely extracting request’s body’s source. | |
| 37904 | + if (request.body != null) { | |
| 37905 | + assert(request.body.source != null) | |
| 37906 | + request.body = safelyExtractBody(request.body.source)[0] | |
| 37907 | + } | |
| 37908 | + | |
| 37909 | + // 15. Let timingInfo be fetchParams’s timing info. | |
| 37910 | + const timingInfo = fetchParams.timingInfo | |
| 37911 | + | |
| 37912 | + // 16. Set timingInfo’s redirect end time and post-redirect start time to the | |
| 37913 | + // coarsened shared current time given fetchParams’s cross-origin isolated | |
| 37914 | + // capability. | |
| 37915 | + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = | |
| 37916 | + coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) | |
| 37917 | + | |
| 37918 | + // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s | |
| 37919 | + // redirect start time to timingInfo’s start time. | |
| 37920 | + if (timingInfo.redirectStartTime === 0) { | |
| 37921 | + timingInfo.redirectStartTime = timingInfo.startTime | |
| 37922 | + } | |
| 37923 | + | |
| 37924 | + // 18. Append locationURL to request’s URL list. | |
| 37925 | + request.urlList.push(locationURL) | |
| 37926 | + | |
| 37927 | + // 19. Invoke set request’s referrer policy on redirect on request and | |
| 37928 | + // actualResponse. | |
| 37929 | + setRequestReferrerPolicyOnRedirect(request, actualResponse) | |
| 37930 | + | |
| 37931 | + // 20. Return the result of running main fetch given fetchParams and true. | |
| 37932 | + return mainFetch(fetchParams, true) | |
| 37933 | +} | |
| 37934 | + | |
| 37935 | +// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch | |
| 37936 | +async function httpNetworkOrCacheFetch ( | |
| 37937 | + fetchParams, | |
| 37938 | + isAuthenticationFetch = false, | |
| 37939 | + isNewConnectionFetch = false | |
| 37940 | +) { | |
| 37941 | + // 1. Let request be fetchParams’s request. | |
| 37942 | + const request = fetchParams.request | |
| 37943 | + | |
| 37944 | + // 2. Let httpFetchParams be null. | |
| 37945 | + let httpFetchParams = null | |
| 37946 | + | |
| 37947 | + // 3. Let httpRequest be null. | |
| 37948 | + let httpRequest = null | |
| 37949 | + | |
| 37950 | + // 4. Let response be null. | |
| 37951 | + let response = null | |
| 37952 | + | |
| 37953 | + // 5. Let storedResponse be null. | |
| 37954 | + // TODO: cache | |
| 37955 | + | |
| 37956 | + // 6. Let httpCache be null. | |
| 37957 | + const httpCache = null | |
| 37958 | + | |
| 37959 | + // 7. Let the revalidatingFlag be unset. | |
| 37960 | + const revalidatingFlag = false | |
| 37961 | + | |
| 37962 | + // 8. Run these steps, but abort when the ongoing fetch is terminated: | |
| 37963 | + | |
| 37964 | + // 1. If request’s window is "no-window" and request’s redirect mode is | |
| 37965 | + // "error", then set httpFetchParams to fetchParams and httpRequest to | |
| 37966 | + // request. | |
| 37967 | + if (request.window === 'no-window' && request.redirect === 'error') { | |
| 37968 | + httpFetchParams = fetchParams | |
| 37969 | + httpRequest = request | |
| 37970 | + } else { | |
| 37971 | + // Otherwise: | |
| 37972 | + | |
| 37973 | + // 1. Set httpRequest to a clone of request. | |
| 37974 | + httpRequest = makeRequest(request) | |
| 37975 | + | |
| 37976 | + // 2. Set httpFetchParams to a copy of fetchParams. | |
| 37977 | + httpFetchParams = { ...fetchParams } | |
| 37978 | + | |
| 37979 | + // 3. Set httpFetchParams’s request to httpRequest. | |
| 37980 | + httpFetchParams.request = httpRequest | |
| 37981 | + } | |
| 37982 | + | |
| 37983 | + // 3. Let includeCredentials be true if one of | |
| 37984 | + const includeCredentials = | |
| 37985 | + request.credentials === 'include' || | |
| 37986 | + (request.credentials === 'same-origin' && | |
| 37987 | + request.responseTainting === 'basic') | |
| 37988 | + | |
| 37989 | + // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s | |
| 37990 | + // body is non-null; otherwise null. | |
| 37991 | + const contentLength = httpRequest.body ? httpRequest.body.length : null | |
| 37992 | + | |
| 37993 | + // 5. Let contentLengthHeaderValue be null. | |
| 37994 | + let contentLengthHeaderValue = null | |
| 37995 | + | |
| 37996 | + // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or | |
| 37997 | + // `PUT`, then set contentLengthHeaderValue to `0`. | |
| 37998 | + if ( | |
| 37999 | + httpRequest.body == null && | |
| 38000 | + ['POST', 'PUT'].includes(httpRequest.method) | |
| 38001 | + ) { | |
| 38002 | + contentLengthHeaderValue = '0' | |
| 38003 | + } | |
| 38004 | + | |
| 38005 | + // 7. If contentLength is non-null, then set contentLengthHeaderValue to | |
| 38006 | + // contentLength, serialized and isomorphic encoded. | |
| 38007 | + if (contentLength != null) { | |
| 38008 | + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) | |
| 38009 | + } | |
| 38010 | + | |
| 38011 | + // 8. If contentLengthHeaderValue is non-null, then append | |
| 38012 | + // `Content-Length`/contentLengthHeaderValue to httpRequest’s header | |
| 38013 | + // list. | |
| 38014 | + if (contentLengthHeaderValue != null) { | |
| 38015 | + httpRequest.headersList.append('content-length', contentLengthHeaderValue) | |
| 38016 | + } | |
| 38017 | + | |
| 38018 | + // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, | |
| 38019 | + // contentLengthHeaderValue) to httpRequest’s header list. | |
| 38020 | + | |
| 38021 | + // 10. If contentLength is non-null and httpRequest’s keepalive is true, | |
| 38022 | + // then: | |
| 38023 | + if (contentLength != null && httpRequest.keepalive) { | |
| 38024 | + // NOTE: keepalive is a noop outside of browser context. | |
| 38025 | + } | |
| 38026 | + | |
| 38027 | + // 11. If httpRequest’s referrer is a URL, then append | |
| 38028 | + // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, | |
| 38029 | + // to httpRequest’s header list. | |
| 38030 | + if (httpRequest.referrer instanceof URL) { | |
| 38031 | + httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) | |
| 38032 | + } | |
| 38033 | + | |
| 38034 | + // 12. Append a request `Origin` header for httpRequest. | |
| 38035 | + appendRequestOriginHeader(httpRequest) | |
| 38036 | + | |
| 38037 | + // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] | |
| 38038 | + appendFetchMetadata(httpRequest) | |
| 38039 | + | |
| 38040 | + // 14. If httpRequest’s header list does not contain `User-Agent`, then | |
| 38041 | + // user agents should append `User-Agent`/default `User-Agent` value to | |
| 38042 | + // httpRequest’s header list. | |
| 38043 | + if (!httpRequest.headersList.contains('user-agent')) { | |
| 38044 | + httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') | |
| 38045 | + } | |
| 38046 | + | |
| 38047 | + // 15. If httpRequest’s cache mode is "default" and httpRequest’s header | |
| 38048 | + // list contains `If-Modified-Since`, `If-None-Match`, | |
| 38049 | + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set | |
| 38050 | + // httpRequest’s cache mode to "no-store". | |
| 38051 | + if ( | |
| 38052 | + httpRequest.cache === 'default' && | |
| 38053 | + (httpRequest.headersList.contains('if-modified-since') || | |
| 38054 | + httpRequest.headersList.contains('if-none-match') || | |
| 38055 | + httpRequest.headersList.contains('if-unmodified-since') || | |
| 38056 | + httpRequest.headersList.contains('if-match') || | |
| 38057 | + httpRequest.headersList.contains('if-range')) | |
| 38058 | + ) { | |
| 38059 | + httpRequest.cache = 'no-store' | |
| 38060 | + } | |
| 38061 | + | |
| 38062 | + // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent | |
| 38063 | + // no-cache cache-control header modification flag is unset, and | |
| 38064 | + // httpRequest’s header list does not contain `Cache-Control`, then append | |
| 38065 | + // `Cache-Control`/`max-age=0` to httpRequest’s header list. | |
| 38066 | + if ( | |
| 38067 | + httpRequest.cache === 'no-cache' && | |
| 38068 | + !httpRequest.preventNoCacheCacheControlHeaderModification && | |
| 38069 | + !httpRequest.headersList.contains('cache-control') | |
| 38070 | + ) { | |
| 38071 | + httpRequest.headersList.append('cache-control', 'max-age=0') | |
| 38072 | + } | |
| 38073 | + | |
| 38074 | + // 17. If httpRequest’s cache mode is "no-store" or "reload", then: | |
| 38075 | + if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { | |
| 38076 | + // 1. If httpRequest’s header list does not contain `Pragma`, then append | |
| 38077 | + // `Pragma`/`no-cache` to httpRequest’s header list. | |
| 38078 | + if (!httpRequest.headersList.contains('pragma')) { | |
| 38079 | + httpRequest.headersList.append('pragma', 'no-cache') | |
| 38080 | + } | |
| 38081 | + | |
| 38082 | + // 2. If httpRequest’s header list does not contain `Cache-Control`, | |
| 38083 | + // then append `Cache-Control`/`no-cache` to httpRequest’s header list. | |
| 38084 | + if (!httpRequest.headersList.contains('cache-control')) { | |
| 38085 | + httpRequest.headersList.append('cache-control', 'no-cache') | |
| 38086 | + } | |
| 38087 | + } | |
| 38088 | + | |
| 38089 | + // 18. If httpRequest’s header list contains `Range`, then append | |
| 38090 | + // `Accept-Encoding`/`identity` to httpRequest’s header list. | |
| 38091 | + if (httpRequest.headersList.contains('range')) { | |
| 38092 | + httpRequest.headersList.append('accept-encoding', 'identity') | |
| 38093 | + } | |
| 38094 | + | |
| 38095 | + // 19. Modify httpRequest’s header list per HTTP. Do not append a given | |
| 38096 | + // header if httpRequest’s header list contains that header’s name. | |
| 38097 | + // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 | |
| 38098 | + if (!httpRequest.headersList.contains('accept-encoding')) { | |
| 38099 | + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { | |
| 38100 | + httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') | |
| 38101 | + } else { | |
| 38102 | + httpRequest.headersList.append('accept-encoding', 'gzip, deflate') | |
| 38103 | + } | |
| 38104 | + } | |
| 38105 | + | |
| 38106 | + httpRequest.headersList.delete('host') | |
| 38107 | + | |
| 38108 | + // 20. If includeCredentials is true, then: | |
| 38109 | + if (includeCredentials) { | |
| 38110 | + // 1. If the user agent is not configured to block cookies for httpRequest | |
| 38111 | + // (see section 7 of [COOKIES]), then: | |
| 38112 | + // TODO: credentials | |
| 38113 | + // 2. If httpRequest’s header list does not contain `Authorization`, then: | |
| 38114 | + // TODO: credentials | |
| 38115 | + } | |
| 38116 | + | |
| 38117 | + // 21. If there’s a proxy-authentication entry, use it as appropriate. | |
| 38118 | + // TODO: proxy-authentication | |
| 38119 | + | |
| 38120 | + // 22. Set httpCache to the result of determining the HTTP cache | |
| 38121 | + // partition, given httpRequest. | |
| 38122 | + // TODO: cache | |
| 38123 | + | |
| 38124 | + // 23. If httpCache is null, then set httpRequest’s cache mode to | |
| 38125 | + // "no-store". | |
| 38126 | + if (httpCache == null) { | |
| 38127 | + httpRequest.cache = 'no-store' | |
| 38128 | + } | |
| 38129 | + | |
| 38130 | + // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", | |
| 38131 | + // then: | |
| 38132 | + if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { | |
| 38133 | + // TODO: cache | |
| 38134 | + } | |
| 38135 | + | |
| 38136 | + // 9. If aborted, then return the appropriate network error for fetchParams. | |
| 38137 | + // TODO | |
| 38138 | + | |
| 38139 | + // 10. If response is null, then: | |
| 38140 | + if (response == null) { | |
| 38141 | + // 1. If httpRequest’s cache mode is "only-if-cached", then return a | |
| 38142 | + // network error. | |
| 38143 | + if (httpRequest.mode === 'only-if-cached') { | |
| 38144 | + return makeNetworkError('only if cached') | |
| 38145 | + } | |
| 38146 | + | |
| 38147 | + // 2. Let forwardResponse be the result of running HTTP-network fetch | |
| 38148 | + // given httpFetchParams, includeCredentials, and isNewConnectionFetch. | |
| 38149 | + const forwardResponse = await httpNetworkFetch( | |
| 38150 | + httpFetchParams, | |
| 38151 | + includeCredentials, | |
| 38152 | + isNewConnectionFetch | |
| 38153 | + ) | |
| 38154 | + | |
| 38155 | + // 3. If httpRequest’s method is unsafe and forwardResponse’s status is | |
| 38156 | + // in the range 200 to 399, inclusive, invalidate appropriate stored | |
| 38157 | + // responses in httpCache, as per the "Invalidation" chapter of HTTP | |
| 38158 | + // Caching, and set storedResponse to null. [HTTP-CACHING] | |
| 38159 | + if ( | |
| 38160 | + !safeMethodsSet.has(httpRequest.method) && | |
| 38161 | + forwardResponse.status >= 200 && | |
| 38162 | + forwardResponse.status <= 399 | |
| 38163 | + ) { | |
| 38164 | + // TODO: cache | |
| 38165 | + } | |
| 38166 | + | |
| 38167 | + // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, | |
| 38168 | + // then: | |
| 38169 | + if (revalidatingFlag && forwardResponse.status === 304) { | |
| 38170 | + // TODO: cache | |
| 38171 | + } | |
| 38172 | + | |
| 38173 | + // 5. If response is null, then: | |
| 38174 | + if (response == null) { | |
| 38175 | + // 1. Set response to forwardResponse. | |
| 38176 | + response = forwardResponse | |
| 38177 | + | |
| 38178 | + // 2. Store httpRequest and forwardResponse in httpCache, as per the | |
| 38179 | + // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] | |
| 38180 | + // TODO: cache | |
| 38181 | + } | |
| 38182 | + } | |
| 38183 | + | |
| 38184 | + // 11. Set response’s URL list to a clone of httpRequest’s URL list. | |
| 38185 | + response.urlList = [...httpRequest.urlList] | |
| 38186 | + | |
| 38187 | + // 12. If httpRequest’s header list contains `Range`, then set response’s | |
| 38188 | + // range-requested flag. | |
| 38189 | + if (httpRequest.headersList.contains('range')) { | |
| 38190 | + response.rangeRequested = true | |
| 38191 | + } | |
| 38192 | + | |
| 38193 | + // 13. Set response’s request-includes-credentials to includeCredentials. | |
| 38194 | + response.requestIncludesCredentials = includeCredentials | |
| 38195 | + | |
| 38196 | + // 14. If response’s status is 401, httpRequest’s response tainting is not | |
| 38197 | + // "cors", includeCredentials is true, and request’s window is an environment | |
| 38198 | + // settings object, then: | |
| 38199 | + // TODO | |
| 38200 | + | |
| 38201 | + // 15. If response’s status is 407, then: | |
| 38202 | + if (response.status === 407) { | |
| 38203 | + // 1. If request’s window is "no-window", then return a network error. | |
| 38204 | + if (request.window === 'no-window') { | |
| 38205 | + return makeNetworkError() | |
| 38206 | + } | |
| 38207 | + | |
| 38208 | + // 2. ??? | |
| 38209 | + | |
| 38210 | + // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. | |
| 38211 | + if (isCancelled(fetchParams)) { | |
| 38212 | + return makeAppropriateNetworkError(fetchParams) | |
| 38213 | + } | |
| 38214 | + | |
| 38215 | + // 4. Prompt the end user as appropriate in request’s window and store | |
| 38216 | + // the result as a proxy-authentication entry. [HTTP-AUTH] | |
| 38217 | + // TODO: Invoke some kind of callback? | |
| 38218 | + | |
| 38219 | + // 5. Set response to the result of running HTTP-network-or-cache fetch given | |
| 38220 | + // fetchParams. | |
| 38221 | + // TODO | |
| 38222 | + return makeNetworkError('proxy authentication required') | |
| 38223 | + } | |
| 38224 | + | |
| 38225 | + // 16. If all of the following are true | |
| 38226 | + if ( | |
| 38227 | + // response’s status is 421 | |
| 38228 | + response.status === 421 && | |
| 38229 | + // isNewConnectionFetch is false | |
| 38230 | + !isNewConnectionFetch && | |
| 38231 | + // request’s body is null, or request’s body is non-null and request’s body’s source is non-null | |
| 38232 | + (request.body == null || request.body.source != null) | |
| 38233 | + ) { | |
| 38234 | + // then: | |
| 38235 | + | |
| 38236 | + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. | |
| 38237 | + if (isCancelled(fetchParams)) { | |
| 38238 | + return makeAppropriateNetworkError(fetchParams) | |
| 38239 | + } | |
| 38240 | + | |
| 38241 | + // 2. Set response to the result of running HTTP-network-or-cache | |
| 38242 | + // fetch given fetchParams, isAuthenticationFetch, and true. | |
| 38243 | + | |
| 38244 | + // TODO (spec): The spec doesn't specify this but we need to cancel | |
| 38245 | + // the active response before we can start a new one. | |
| 38246 | + // https://github.com/whatwg/fetch/issues/1293 | |
| 38247 | + fetchParams.controller.connection.destroy() | |
| 38248 | + | |
| 38249 | + response = await httpNetworkOrCacheFetch( | |
| 38250 | + fetchParams, | |
| 38251 | + isAuthenticationFetch, | |
| 38252 | + true | |
| 38253 | + ) | |
| 38254 | + } | |
| 38255 | + | |
| 38256 | + // 17. If isAuthenticationFetch is true, then create an authentication entry | |
| 38257 | + if (isAuthenticationFetch) { | |
| 38258 | + // TODO | |
| 38259 | + } | |
| 38260 | + | |
| 38261 | + // 18. Return response. | |
| 38262 | + return response | |
| 38263 | +} | |
| 38264 | + | |
| 38265 | +// https://fetch.spec.whatwg.org/#http-network-fetch | |
| 38266 | +async function httpNetworkFetch ( | |
| 38267 | + fetchParams, | |
| 38268 | + includeCredentials = false, | |
| 38269 | + forceNewConnection = false | |
| 38270 | +) { | |
| 38271 | + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) | |
| 38272 | + | |
| 38273 | + fetchParams.controller.connection = { | |
| 38274 | + abort: null, | |
| 38275 | + destroyed: false, | |
| 38276 | + destroy (err) { | |
| 38277 | + if (!this.destroyed) { | |
| 38278 | + this.destroyed = true | |
| 38279 | + this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) | |
| 38280 | + } | |
| 38281 | + } | |
| 38282 | + } | |
| 38283 | + | |
| 38284 | + // 1. Let request be fetchParams’s request. | |
| 38285 | + const request = fetchParams.request | |
| 38286 | + | |
| 38287 | + // 2. Let response be null. | |
| 38288 | + let response = null | |
| 38289 | + | |
| 38290 | + // 3. Let timingInfo be fetchParams’s timing info. | |
| 38291 | + const timingInfo = fetchParams.timingInfo | |
| 38292 | + | |
| 38293 | + // 4. Let httpCache be the result of determining the HTTP cache partition, | |
| 38294 | + // given request. | |
| 38295 | + // TODO: cache | |
| 38296 | + const httpCache = null | |
| 38297 | + | |
| 38298 | + // 5. If httpCache is null, then set request’s cache mode to "no-store". | |
| 38299 | + if (httpCache == null) { | |
| 38300 | + request.cache = 'no-store' | |
| 38301 | + } | |
| 38302 | + | |
| 38303 | + // 6. Let networkPartitionKey be the result of determining the network | |
| 38304 | + // partition key given request. | |
| 38305 | + // TODO | |
| 38306 | + | |
| 38307 | + // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise | |
| 38308 | + // "no". | |
| 38309 | + const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars | |
| 38310 | + | |
| 38311 | + // 8. Switch on request’s mode: | |
| 38312 | + if (request.mode === 'websocket') { | |
| 38313 | + // Let connection be the result of obtaining a WebSocket connection, | |
| 38314 | + // given request’s current URL. | |
| 38315 | + // TODO | |
| 38316 | + } else { | |
| 38317 | + // Let connection be the result of obtaining a connection, given | |
| 38318 | + // networkPartitionKey, request’s current URL’s origin, | |
| 38319 | + // includeCredentials, and forceNewConnection. | |
| 38320 | + // TODO | |
| 38321 | + } | |
| 38322 | + | |
| 38323 | + // 9. Run these steps, but abort when the ongoing fetch is terminated: | |
| 38324 | + | |
| 38325 | + // 1. If connection is failure, then return a network error. | |
| 38326 | + | |
| 38327 | + // 2. Set timingInfo’s final connection timing info to the result of | |
| 38328 | + // calling clamp and coarsen connection timing info with connection’s | |
| 38329 | + // timing info, timingInfo’s post-redirect start time, and fetchParams’s | |
| 38330 | + // cross-origin isolated capability. | |
| 38331 | + | |
| 38332 | + // 3. If connection is not an HTTP/2 connection, request’s body is non-null, | |
| 38333 | + // and request’s body’s source is null, then append (`Transfer-Encoding`, | |
| 38334 | + // `chunked`) to request’s header list. | |
| 38335 | + | |
| 38336 | + // 4. Set timingInfo’s final network-request start time to the coarsened | |
| 38337 | + // shared current time given fetchParams’s cross-origin isolated | |
| 38338 | + // capability. | |
| 38339 | + | |
| 38340 | + // 5. Set response to the result of making an HTTP request over connection | |
| 38341 | + // using request with the following caveats: | |
| 38342 | + | |
| 38343 | + // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] | |
| 38344 | + // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] | |
| 38345 | + | |
| 38346 | + // - If request’s body is non-null, and request’s body’s source is null, | |
| 38347 | + // then the user agent may have a buffer of up to 64 kibibytes and store | |
| 38348 | + // a part of request’s body in that buffer. If the user agent reads from | |
| 38349 | + // request’s body beyond that buffer’s size and the user agent needs to | |
| 38350 | + // resend request, then instead return a network error. | |
| 38351 | + | |
| 38352 | + // - Set timingInfo’s final network-response start time to the coarsened | |
| 38353 | + // shared current time given fetchParams’s cross-origin isolated capability, | |
| 38354 | + // immediately after the user agent’s HTTP parser receives the first byte | |
| 38355 | + // of the response (e.g., frame header bytes for HTTP/2 or response status | |
| 38356 | + // line for HTTP/1.x). | |
| 38357 | + | |
| 38358 | + // - Wait until all the headers are transmitted. | |
| 38359 | + | |
| 38360 | + // - Any responses whose status is in the range 100 to 199, inclusive, | |
| 38361 | + // and is not 101, are to be ignored, except for the purposes of setting | |
| 38362 | + // timingInfo’s final network-response start time above. | |
| 38363 | + | |
| 38364 | + // - If request’s header list contains `Transfer-Encoding`/`chunked` and | |
| 38365 | + // response is transferred via HTTP/1.0 or older, then return a network | |
| 38366 | + // error. | |
| 38367 | + | |
| 38368 | + // - If the HTTP request results in a TLS client certificate dialog, then: | |
| 38369 | + | |
| 38370 | + // 1. If request’s window is an environment settings object, make the | |
| 38371 | + // dialog available in request’s window. | |
| 38372 | + | |
| 38373 | + // 2. Otherwise, return a network error. | |
| 38374 | + | |
| 38375 | + // To transmit request’s body body, run these steps: | |
| 38376 | + let requestBody = null | |
| 38377 | + // 1. If body is null and fetchParams’s process request end-of-body is | |
| 38378 | + // non-null, then queue a fetch task given fetchParams’s process request | |
| 38379 | + // end-of-body and fetchParams’s task destination. | |
| 38380 | + if (request.body == null && fetchParams.processRequestEndOfBody) { | |
| 38381 | + queueMicrotask(() => fetchParams.processRequestEndOfBody()) | |
| 38382 | + } else if (request.body != null) { | |
| 38383 | + // 2. Otherwise, if body is non-null: | |
| 38384 | + | |
| 38385 | + // 1. Let processBodyChunk given bytes be these steps: | |
| 38386 | + const processBodyChunk = async function * (bytes) { | |
| 38387 | + // 1. If the ongoing fetch is terminated, then abort these steps. | |
| 38388 | + if (isCancelled(fetchParams)) { | |
| 38389 | + return | |
| 38390 | + } | |
| 38391 | + | |
| 38392 | + // 2. Run this step in parallel: transmit bytes. | |
| 38393 | + yield bytes | |
| 38394 | + | |
| 38395 | + // 3. If fetchParams’s process request body is non-null, then run | |
| 38396 | + // fetchParams’s process request body given bytes’s length. | |
| 38397 | + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) | |
| 38398 | + } | |
| 38399 | + | |
| 38400 | + // 2. Let processEndOfBody be these steps: | |
| 38401 | + const processEndOfBody = () => { | |
| 38402 | + // 1. If fetchParams is canceled, then abort these steps. | |
| 38403 | + if (isCancelled(fetchParams)) { | |
| 38404 | + return | |
| 38405 | + } | |
| 38406 | + | |
| 38407 | + // 2. If fetchParams’s process request end-of-body is non-null, | |
| 38408 | + // then run fetchParams’s process request end-of-body. | |
| 38409 | + if (fetchParams.processRequestEndOfBody) { | |
| 38410 | + fetchParams.processRequestEndOfBody() | |
| 38411 | + } | |
| 38412 | + } | |
| 38413 | + | |
| 38414 | + // 3. Let processBodyError given e be these steps: | |
| 38415 | + const processBodyError = (e) => { | |
| 38416 | + // 1. If fetchParams is canceled, then abort these steps. | |
| 38417 | + if (isCancelled(fetchParams)) { | |
| 38418 | + return | |
| 38419 | + } | |
| 38420 | + | |
| 38421 | + // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. | |
| 38422 | + if (e.name === 'AbortError') { | |
| 38423 | + fetchParams.controller.abort() | |
| 38424 | + } else { | |
| 38425 | + fetchParams.controller.terminate(e) | |
| 38426 | + } | |
| 38427 | + } | |
| 38428 | + | |
| 38429 | + // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, | |
| 38430 | + // processBodyError, and fetchParams’s task destination. | |
| 38431 | + requestBody = (async function * () { | |
| 38432 | + try { | |
| 38433 | + for await (const bytes of request.body.stream) { | |
| 38434 | + yield * processBodyChunk(bytes) | |
| 38435 | + } | |
| 38436 | + processEndOfBody() | |
| 38437 | + } catch (err) { | |
| 38438 | + processBodyError(err) | |
| 38439 | + } | |
| 38440 | + })() | |
| 38441 | + } | |
| 38442 | + | |
| 38443 | + try { | |
| 38444 | + // socket is only provided for websockets | |
| 38445 | + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) | |
| 38446 | + | |
| 38447 | + if (socket) { | |
| 38448 | + response = makeResponse({ status, statusText, headersList, socket }) | |
| 38449 | + } else { | |
| 38450 | + const iterator = body[Symbol.asyncIterator]() | |
| 38451 | + fetchParams.controller.next = () => iterator.next() | |
| 38452 | + | |
| 38453 | + response = makeResponse({ status, statusText, headersList }) | |
| 38454 | + } | |
| 38455 | + } catch (err) { | |
| 38456 | + // 10. If aborted, then: | |
| 38457 | + if (err.name === 'AbortError') { | |
| 38458 | + // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. | |
| 38459 | + fetchParams.controller.connection.destroy() | |
| 38460 | + | |
| 38461 | + // 2. Return the appropriate network error for fetchParams. | |
| 38462 | + return makeAppropriateNetworkError(fetchParams, err) | |
| 38463 | + } | |
| 38464 | + | |
| 38465 | + return makeNetworkError(err) | |
| 38466 | + } | |
| 38467 | + | |
| 38468 | + // 11. Let pullAlgorithm be an action that resumes the ongoing fetch | |
| 38469 | + // if it is suspended. | |
| 38470 | + const pullAlgorithm = () => { | |
| 38471 | + fetchParams.controller.resume() | |
| 38472 | + } | |
| 38473 | + | |
| 38474 | + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s | |
| 38475 | + // controller with reason, given reason. | |
| 38476 | + const cancelAlgorithm = (reason) => { | |
| 38477 | + fetchParams.controller.abort(reason) | |
| 38478 | + } | |
| 38479 | + | |
| 38480 | + // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by | |
| 38481 | + // the user agent. | |
| 38482 | + // TODO | |
| 38483 | + | |
| 38484 | + // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object | |
| 38485 | + // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. | |
| 38486 | + // TODO | |
| 38487 | + | |
| 38488 | + // 15. Let stream be a new ReadableStream. | |
| 38489 | + // 16. Set up stream with pullAlgorithm set to pullAlgorithm, | |
| 38490 | + // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to | |
| 38491 | + // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. | |
| 38492 | + if (!ReadableStream) { | |
| 38493 | + ReadableStream = (__nccwpck_require__(3774).ReadableStream) | |
| 38494 | + } | |
| 38495 | + | |
| 38496 | + const stream = new ReadableStream( | |
| 38497 | + { | |
| 38498 | + async start (controller) { | |
| 38499 | + fetchParams.controller.controller = controller | |
| 38500 | + }, | |
| 38501 | + async pull (controller) { | |
| 38502 | + await pullAlgorithm(controller) | |
| 38503 | + }, | |
| 38504 | + async cancel (reason) { | |
| 38505 | + await cancelAlgorithm(reason) | |
| 38506 | + } | |
| 38507 | + }, | |
| 38508 | + { | |
| 38509 | + highWaterMark: 0, | |
| 38510 | + size () { | |
| 38511 | + return 1 | |
| 38512 | + } | |
| 38513 | + } | |
| 38514 | + ) | |
| 38515 | + | |
| 38516 | + // 17. Run these steps, but abort when the ongoing fetch is terminated: | |
| 38517 | + | |
| 38518 | + // 1. Set response’s body to a new body whose stream is stream. | |
| 38519 | + response.body = { stream } | |
| 38520 | + | |
| 38521 | + // 2. If response is not a network error and request’s cache mode is | |
| 38522 | + // not "no-store", then update response in httpCache for request. | |
| 38523 | + // TODO | |
| 38524 | + | |
| 38525 | + // 3. If includeCredentials is true and the user agent is not configured | |
| 38526 | + // to block cookies for request (see section 7 of [COOKIES]), then run the | |
| 38527 | + // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on | |
| 38528 | + // the value of each header whose name is a byte-case-insensitive match for | |
| 38529 | + // `Set-Cookie` in response’s header list, if any, and request’s current URL. | |
| 38530 | + // TODO | |
| 38531 | + | |
| 38532 | + // 18. If aborted, then: | |
| 38533 | + // TODO | |
| 38534 | + | |
| 38535 | + // 19. Run these steps in parallel: | |
| 38536 | + | |
| 38537 | + // 1. Run these steps, but abort when fetchParams is canceled: | |
| 38538 | + fetchParams.controller.on('terminated', onAborted) | |
| 38539 | + fetchParams.controller.resume = async () => { | |
| 38540 | + // 1. While true | |
| 38541 | + while (true) { | |
| 38542 | + // 1-3. See onData... | |
| 38543 | + | |
| 38544 | + // 4. Set bytes to the result of handling content codings given | |
| 38545 | + // codings and bytes. | |
| 38546 | + let bytes | |
| 38547 | + let isFailure | |
| 38548 | + try { | |
| 38549 | + const { done, value } = await fetchParams.controller.next() | |
| 38550 | + | |
| 38551 | + if (isAborted(fetchParams)) { | |
| 38552 | + break | |
| 38553 | + } | |
| 38554 | + | |
| 38555 | + bytes = done ? undefined : value | |
| 38556 | + } catch (err) { | |
| 38557 | + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { | |
| 38558 | + // zlib doesn't like empty streams. | |
| 38559 | + bytes = undefined | |
| 38560 | + } else { | |
| 38561 | + bytes = err | |
| 38562 | + | |
| 38563 | + // err may be propagated from the result of calling readablestream.cancel, | |
| 38564 | + // which might not be an error. https://github.com/nodejs/undici/issues/2009 | |
| 38565 | + isFailure = true | |
| 38566 | + } | |
| 38567 | + } | |
| 38568 | + | |
| 38569 | + if (bytes === undefined) { | |
| 38570 | + // 2. Otherwise, if the bytes transmission for response’s message | |
| 38571 | + // body is done normally and stream is readable, then close | |
| 38572 | + // stream, finalize response for fetchParams and response, and | |
| 38573 | + // abort these in-parallel steps. | |
| 38574 | + readableStreamClose(fetchParams.controller.controller) | |
| 38575 | + | |
| 38576 | + finalizeResponse(fetchParams, response) | |
| 38577 | + | |
| 38578 | + return | |
| 38579 | + } | |
| 38580 | + | |
| 38581 | + // 5. Increase timingInfo’s decoded body size by bytes’s length. | |
| 38582 | + timingInfo.decodedBodySize += bytes?.byteLength ?? 0 | |
| 38583 | + | |
| 38584 | + // 6. If bytes is failure, then terminate fetchParams’s controller. | |
| 38585 | + if (isFailure) { | |
| 38586 | + fetchParams.controller.terminate(bytes) | |
| 38587 | + return | |
| 38588 | + } | |
| 38589 | + | |
| 38590 | + // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes | |
| 38591 | + // into stream. | |
| 38592 | + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) | |
| 38593 | + | |
| 38594 | + // 8. If stream is errored, then terminate the ongoing fetch. | |
| 38595 | + if (isErrored(stream)) { | |
| 38596 | + fetchParams.controller.terminate() | |
| 38597 | + return | |
| 38598 | + } | |
| 38599 | + | |
| 38600 | + // 9. If stream doesn’t need more data ask the user agent to suspend | |
| 38601 | + // the ongoing fetch. | |
| 38602 | + if (!fetchParams.controller.controller.desiredSize) { | |
| 38603 | + return | |
| 38604 | + } | |
| 38605 | + } | |
| 38606 | + } | |
| 38607 | + | |
| 38608 | + // 2. If aborted, then: | |
| 38609 | + function onAborted (reason) { | |
| 38610 | + // 2. If fetchParams is aborted, then: | |
| 38611 | + if (isAborted(fetchParams)) { | |
| 38612 | + // 1. Set response’s aborted flag. | |
| 38613 | + response.aborted = true | |
| 38614 | + | |
| 38615 | + // 2. If stream is readable, then error stream with the result of | |
| 38616 | + // deserialize a serialized abort reason given fetchParams’s | |
| 38617 | + // controller’s serialized abort reason and an | |
| 38618 | + // implementation-defined realm. | |
| 38619 | + if (isReadable(stream)) { | |
| 38620 | + fetchParams.controller.controller.error( | |
| 38621 | + fetchParams.controller.serializedAbortReason | |
| 38622 | + ) | |
| 38623 | + } | |
| 38624 | + } else { | |
| 38625 | + // 3. Otherwise, if stream is readable, error stream with a TypeError. | |
| 38626 | + if (isReadable(stream)) { | |
| 38627 | + fetchParams.controller.controller.error(new TypeError('terminated', { | |
| 38628 | + cause: isErrorLike(reason) ? reason : undefined | |
| 38629 | + })) | |
| 38630 | + } | |
| 38631 | + } | |
| 38632 | + | |
| 38633 | + // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. | |
| 38634 | + // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. | |
| 38635 | + fetchParams.controller.connection.destroy() | |
| 38636 | + } | |
| 38637 | + | |
| 38638 | + // 20. Return response. | |
| 38639 | + return response | |
| 38640 | + | |
| 38641 | + async function dispatch ({ body }) { | |
| 38642 | + const url = requestCurrentURL(request) | |
| 38643 | + /** @type {import('../..').Agent} */ | |
| 38644 | + const agent = fetchParams.controller.dispatcher | |
| 38645 | + | |
| 38646 | + return new Promise((resolve, reject) => agent.dispatch( | |
| 38647 | + { | |
| 38648 | + path: url.pathname + url.search, | |
| 38649 | + origin: url.origin, | |
| 38650 | + method: request.method, | |
| 38651 | + body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, | |
| 38652 | + headers: request.headersList.entries, | |
| 38653 | + maxRedirections: 0, | |
| 38654 | + upgrade: request.mode === 'websocket' ? 'websocket' : undefined | |
| 38655 | + }, | |
| 38656 | + { | |
| 38657 | + body: null, | |
| 38658 | + abort: null, | |
| 38659 | + | |
| 38660 | + onConnect (abort) { | |
| 38661 | + // TODO (fix): Do we need connection here? | |
| 38662 | + const { connection } = fetchParams.controller | |
| 38663 | + | |
| 38664 | + if (connection.destroyed) { | |
| 38665 | + abort(new DOMException('The operation was aborted.', 'AbortError')) | |
| 38666 | + } else { | |
| 38667 | + fetchParams.controller.on('terminated', abort) | |
| 38668 | + this.abort = connection.abort = abort | |
| 38669 | + } | |
| 38670 | + }, | |
| 38671 | + | |
| 38672 | + onHeaders (status, headersList, resume, statusText) { | |
| 38673 | + if (status < 200) { | |
| 38674 | + return | |
| 38675 | + } | |
| 38676 | + | |
| 38677 | + let codings = [] | |
| 38678 | + let location = '' | |
| 38679 | + | |
| 38680 | + const headers = new Headers() | |
| 38681 | + | |
| 38682 | + // For H2, the headers are a plain JS object | |
| 38683 | + // We distinguish between them and iterate accordingly | |
| 38684 | + if (Array.isArray(headersList)) { | |
| 38685 | + for (let n = 0; n < headersList.length; n += 2) { | |
| 38686 | + const key = headersList[n + 0].toString('latin1') | |
| 38687 | + const val = headersList[n + 1].toString('latin1') | |
| 38688 | + if (key.toLowerCase() === 'content-encoding') { | |
| 38689 | + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 | |
| 38690 | + // "All content-coding values are case-insensitive..." | |
| 38691 | + codings = val.toLowerCase().split(',').map((x) => x.trim()) | |
| 38692 | + } else if (key.toLowerCase() === 'location') { | |
| 38693 | + location = val | |
| 38694 | + } | |
| 38695 | + | |
| 38696 | + headers[kHeadersList].append(key, val) | |
| 38697 | + } | |
| 38698 | + } else { | |
| 38699 | + const keys = Object.keys(headersList) | |
| 38700 | + for (const key of keys) { | |
| 38701 | + const val = headersList[key] | |
| 38702 | + if (key.toLowerCase() === 'content-encoding') { | |
| 38703 | + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 | |
| 38704 | + // "All content-coding values are case-insensitive..." | |
| 38705 | + codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() | |
| 38706 | + } else if (key.toLowerCase() === 'location') { | |
| 38707 | + location = val | |
| 38708 | + } | |
| 38709 | + | |
| 38710 | + headers[kHeadersList].append(key, val) | |
| 38711 | + } | |
| 38712 | + } | |
| 38713 | + | |
| 38714 | + this.body = new Readable({ read: resume }) | |
| 38715 | + | |
| 38716 | + const decoders = [] | |
| 38717 | + | |
| 38718 | + const willFollow = request.redirect === 'follow' && | |
| 38719 | + location && | |
| 38720 | + redirectStatusSet.has(status) | |
| 38721 | + | |
| 38722 | + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding | |
| 38723 | + if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { | |
| 38724 | + for (const coding of codings) { | |
| 38725 | + // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 | |
| 38726 | + if (coding === 'x-gzip' || coding === 'gzip') { | |
| 38727 | + decoders.push(zlib.createGunzip({ | |
| 38728 | + // Be less strict when decoding compressed responses, since sometimes | |
| 38729 | + // servers send slightly invalid responses that are still accepted | |
| 38730 | + // by common browsers. | |
| 38731 | + // Always using Z_SYNC_FLUSH is what cURL does. | |
| 38732 | + flush: zlib.constants.Z_SYNC_FLUSH, | |
| 38733 | + finishFlush: zlib.constants.Z_SYNC_FLUSH | |
| 38734 | + })) | |
| 38735 | + } else if (coding === 'deflate') { | |
| 38736 | + decoders.push(zlib.createInflate()) | |
| 38737 | + } else if (coding === 'br') { | |
| 38738 | + decoders.push(zlib.createBrotliDecompress()) | |
| 38739 | + } else { | |
| 38740 | + decoders.length = 0 | |
| 38741 | + break | |
| 38742 | + } | |
| 38743 | + } | |
| 38744 | + } | |
| 38745 | + | |
| 38746 | + resolve({ | |
| 38747 | + status, | |
| 38748 | + statusText, | |
| 38749 | + headersList: headers[kHeadersList], | |
| 38750 | + body: decoders.length | |
| 38751 | + ? pipeline(this.body, ...decoders, () => { }) | |
| 38752 | + : this.body.on('error', () => {}) | |
| 38753 | + }) | |
| 38754 | + | |
| 38755 | + return true | |
| 38756 | + }, | |
| 38757 | + | |
| 38758 | + onData (chunk) { | |
| 38759 | + if (fetchParams.controller.dump) { | |
| 38760 | + return | |
| 38761 | + } | |
| 38762 | + | |
| 38763 | + // 1. If one or more bytes have been transmitted from response’s | |
| 38764 | + // message body, then: | |
| 38765 | + | |
| 38766 | + // 1. Let bytes be the transmitted bytes. | |
| 38767 | + const bytes = chunk | |
| 38768 | + | |
| 38769 | + // 2. Let codings be the result of extracting header list values | |
| 38770 | + // given `Content-Encoding` and response’s header list. | |
| 38771 | + // See pullAlgorithm. | |
| 38772 | + | |
| 38773 | + // 3. Increase timingInfo’s encoded body size by bytes’s length. | |
| 38774 | + timingInfo.encodedBodySize += bytes.byteLength | |
| 38775 | + | |
| 38776 | + // 4. See pullAlgorithm... | |
| 38777 | + | |
| 38778 | + return this.body.push(bytes) | |
| 38779 | + }, | |
| 38780 | + | |
| 38781 | + onComplete () { | |
| 38782 | + if (this.abort) { | |
| 38783 | + fetchParams.controller.off('terminated', this.abort) | |
| 38784 | + } | |
| 38785 | + | |
| 38786 | + fetchParams.controller.ended = true | |
| 38787 | + | |
| 38788 | + this.body.push(null) | |
| 38789 | + }, | |
| 38790 | + | |
| 38791 | + onError (error) { | |
| 38792 | + if (this.abort) { | |
| 38793 | + fetchParams.controller.off('terminated', this.abort) | |
| 38794 | + } | |
| 38795 | + | |
| 38796 | + this.body?.destroy(error) | |
| 38797 | + | |
| 38798 | + fetchParams.controller.terminate(error) | |
| 38799 | + | |
| 38800 | + reject(error) | |
| 38801 | + }, | |
| 38802 | + | |
| 38803 | + onUpgrade (status, headersList, socket) { | |
| 38804 | + if (status !== 101) { | |
| 38805 | + return | |
| 38806 | + } | |
| 38807 | + | |
| 38808 | + const headers = new Headers() | |
| 38809 | + | |
| 38810 | + for (let n = 0; n < headersList.length; n += 2) { | |
| 38811 | + const key = headersList[n + 0].toString('latin1') | |
| 38812 | + const val = headersList[n + 1].toString('latin1') | |
| 38813 | + | |
| 38814 | + headers[kHeadersList].append(key, val) | |
| 38815 | + } | |
| 38816 | + | |
| 38817 | + resolve({ | |
| 38818 | + status, | |
| 38819 | + statusText: STATUS_CODES[status], | |
| 38820 | + headersList: headers[kHeadersList], | |
| 38821 | + socket | |
| 38822 | + }) | |
| 38823 | + | |
| 38824 | + return true | |
| 38825 | + } | |
| 38826 | + } | |
| 38827 | + )) | |
| 38828 | + } | |
| 38829 | +} | |
| 38830 | + | |
| 38831 | +module.exports = { | |
| 38832 | + fetch, | |
| 38833 | + Fetch, | |
| 38834 | + fetching, | |
| 38835 | + finalizeAndReportTiming | |
| 38836 | +} | |
| 38837 | + | |
| 38838 | + | |
| 38839 | +/***/ }), | |
| 38840 | + | |
| 38841 | +/***/ 5194: | |
| 38842 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 38843 | + | |
| 38844 | +"use strict"; | |
| 38845 | +/* globals AbortController */ | |
| 38846 | + | |
| 38847 | + | |
| 38848 | + | |
| 38849 | +const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(8923) | |
| 38850 | +const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(6349) | |
| 38851 | +const { FinalizationRegistry } = __nccwpck_require__(3194)() | |
| 38852 | +const util = __nccwpck_require__(3440) | |
| 38853 | +const { | |
| 38854 | + isValidHTTPToken, | |
| 38855 | + sameOrigin, | |
| 38856 | + normalizeMethod, | |
| 38857 | + makePolicyContainer, | |
| 38858 | + normalizeMethodRecord | |
| 38859 | +} = __nccwpck_require__(5523) | |
| 38860 | +const { | |
| 38861 | + forbiddenMethodsSet, | |
| 38862 | + corsSafeListedMethodsSet, | |
| 38863 | + referrerPolicy, | |
| 38864 | + requestRedirect, | |
| 38865 | + requestMode, | |
| 38866 | + requestCredentials, | |
| 38867 | + requestCache, | |
| 38868 | + requestDuplex | |
| 38869 | +} = __nccwpck_require__(7326) | |
| 38870 | +const { kEnumerableProperty } = util | |
| 38871 | +const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(9710) | |
| 38872 | +const { webidl } = __nccwpck_require__(4222) | |
| 38873 | +const { getGlobalOrigin } = __nccwpck_require__(5628) | |
| 38874 | +const { URLSerializer } = __nccwpck_require__(4322) | |
| 38875 | +const { kHeadersList, kConstruct } = __nccwpck_require__(6443) | |
| 38876 | +const assert = __nccwpck_require__(2613) | |
| 38877 | +const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(4434) | |
| 38878 | + | |
| 38879 | +let TransformStream = globalThis.TransformStream | |
| 38880 | + | |
| 38881 | +const kAbortController = Symbol('abortController') | |
| 38882 | + | |
| 38883 | +const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { | |
| 38884 | + signal.removeEventListener('abort', abort) | |
| 38885 | +}) | |
| 38886 | + | |
| 38887 | +// https://fetch.spec.whatwg.org/#request-class | |
| 38888 | +class Request { | |
| 38889 | + // https://fetch.spec.whatwg.org/#dom-request | |
| 38890 | + constructor (input, init = {}) { | |
| 38891 | + if (input === kConstruct) { | |
| 38892 | + return | |
| 38893 | + } | |
| 38894 | + | |
| 38895 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) | |
| 38896 | + | |
| 38897 | + input = webidl.converters.RequestInfo(input) | |
| 38898 | + init = webidl.converters.RequestInit(init) | |
| 38899 | + | |
| 38900 | + // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object | |
| 38901 | + this[kRealm] = { | |
| 38902 | + settingsObject: { | |
| 38903 | + baseUrl: getGlobalOrigin(), | |
| 38904 | + get origin () { | |
| 38905 | + return this.baseUrl?.origin | |
| 38906 | + }, | |
| 38907 | + policyContainer: makePolicyContainer() | |
| 38908 | + } | |
| 38909 | + } | |
| 38910 | + | |
| 38911 | + // 1. Let request be null. | |
| 38912 | + let request = null | |
| 38913 | + | |
| 38914 | + // 2. Let fallbackMode be null. | |
| 38915 | + let fallbackMode = null | |
| 38916 | + | |
| 38917 | + // 3. Let baseURL be this’s relevant settings object’s API base URL. | |
| 38918 | + const baseUrl = this[kRealm].settingsObject.baseUrl | |
| 38919 | + | |
| 38920 | + // 4. Let signal be null. | |
| 38921 | + let signal = null | |
| 38922 | + | |
| 38923 | + // 5. If input is a string, then: | |
| 38924 | + if (typeof input === 'string') { | |
| 38925 | + // 1. Let parsedURL be the result of parsing input with baseURL. | |
| 38926 | + // 2. If parsedURL is failure, then throw a TypeError. | |
| 38927 | + let parsedURL | |
| 38928 | + try { | |
| 38929 | + parsedURL = new URL(input, baseUrl) | |
| 38930 | + } catch (err) { | |
| 38931 | + throw new TypeError('Failed to parse URL from ' + input, { cause: err }) | |
| 38932 | + } | |
| 38933 | + | |
| 38934 | + // 3. If parsedURL includes credentials, then throw a TypeError. | |
| 38935 | + if (parsedURL.username || parsedURL.password) { | |
| 38936 | + throw new TypeError( | |
| 38937 | + 'Request cannot be constructed from a URL that includes credentials: ' + | |
| 38938 | + input | |
| 38939 | + ) | |
| 38940 | + } | |
| 38941 | + | |
| 38942 | + // 4. Set request to a new request whose URL is parsedURL. | |
| 38943 | + request = makeRequest({ urlList: [parsedURL] }) | |
| 38944 | + | |
| 38945 | + // 5. Set fallbackMode to "cors". | |
| 38946 | + fallbackMode = 'cors' | |
| 38947 | + } else { | |
| 38948 | + // 6. Otherwise: | |
| 38949 | + | |
| 38950 | + // 7. Assert: input is a Request object. | |
| 38951 | + assert(input instanceof Request) | |
| 38952 | + | |
| 38953 | + // 8. Set request to input’s request. | |
| 38954 | + request = input[kState] | |
| 38955 | + | |
| 38956 | + // 9. Set signal to input’s signal. | |
| 38957 | + signal = input[kSignal] | |
| 38958 | + } | |
| 38959 | + | |
| 38960 | + // 7. Let origin be this’s relevant settings object’s origin. | |
| 38961 | + const origin = this[kRealm].settingsObject.origin | |
| 38962 | + | |
| 38963 | + // 8. Let window be "client". | |
| 38964 | + let window = 'client' | |
| 38965 | + | |
| 38966 | + // 9. If request’s window is an environment settings object and its origin | |
| 38967 | + // is same origin with origin, then set window to request’s window. | |
| 38968 | + if ( | |
| 38969 | + request.window?.constructor?.name === 'EnvironmentSettingsObject' && | |
| 38970 | + sameOrigin(request.window, origin) | |
| 38971 | + ) { | |
| 38972 | + window = request.window | |
| 38973 | + } | |
| 38974 | + | |
| 38975 | + // 10. If init["window"] exists and is non-null, then throw a TypeError. | |
| 38976 | + if (init.window != null) { | |
| 38977 | + throw new TypeError(`'window' option '${window}' must be null`) | |
| 38978 | + } | |
| 38979 | + | |
| 38980 | + // 11. If init["window"] exists, then set window to "no-window". | |
| 38981 | + if ('window' in init) { | |
| 38982 | + window = 'no-window' | |
| 38983 | + } | |
| 38984 | + | |
| 38985 | + // 12. Set request to a new request with the following properties: | |
| 38986 | + request = makeRequest({ | |
| 38987 | + // URL request’s URL. | |
| 38988 | + // undici implementation note: this is set as the first item in request's urlList in makeRequest | |
| 38989 | + // method request’s method. | |
| 38990 | + method: request.method, | |
| 38991 | + // header list A copy of request’s header list. | |
| 38992 | + // undici implementation note: headersList is cloned in makeRequest | |
| 38993 | + headersList: request.headersList, | |
| 38994 | + // unsafe-request flag Set. | |
| 38995 | + unsafeRequest: request.unsafeRequest, | |
| 38996 | + // client This’s relevant settings object. | |
| 38997 | + client: this[kRealm].settingsObject, | |
| 38998 | + // window window. | |
| 38999 | + window, | |
| 39000 | + // priority request’s priority. | |
| 39001 | + priority: request.priority, | |
| 39002 | + // origin request’s origin. The propagation of the origin is only significant for navigation requests | |
| 39003 | + // being handled by a service worker. In this scenario a request can have an origin that is different | |
| 39004 | + // from the current client. | |
| 39005 | + origin: request.origin, | |
| 39006 | + // referrer request’s referrer. | |
| 39007 | + referrer: request.referrer, | |
| 39008 | + // referrer policy request’s referrer policy. | |
| 39009 | + referrerPolicy: request.referrerPolicy, | |
| 39010 | + // mode request’s mode. | |
| 39011 | + mode: request.mode, | |
| 39012 | + // credentials mode request’s credentials mode. | |
| 39013 | + credentials: request.credentials, | |
| 39014 | + // cache mode request’s cache mode. | |
| 39015 | + cache: request.cache, | |
| 39016 | + // redirect mode request’s redirect mode. | |
| 39017 | + redirect: request.redirect, | |
| 39018 | + // integrity metadata request’s integrity metadata. | |
| 39019 | + integrity: request.integrity, | |
| 39020 | + // keepalive request’s keepalive. | |
| 39021 | + keepalive: request.keepalive, | |
| 39022 | + // reload-navigation flag request’s reload-navigation flag. | |
| 39023 | + reloadNavigation: request.reloadNavigation, | |
| 39024 | + // history-navigation flag request’s history-navigation flag. | |
| 39025 | + historyNavigation: request.historyNavigation, | |
| 39026 | + // URL list A clone of request’s URL list. | |
| 39027 | + urlList: [...request.urlList] | |
| 39028 | + }) | |
| 39029 | + | |
| 39030 | + const initHasKey = Object.keys(init).length !== 0 | |
| 39031 | + | |
| 39032 | + // 13. If init is not empty, then: | |
| 39033 | + if (initHasKey) { | |
| 39034 | + // 1. If request’s mode is "navigate", then set it to "same-origin". | |
| 39035 | + if (request.mode === 'navigate') { | |
| 39036 | + request.mode = 'same-origin' | |
| 39037 | + } | |
| 39038 | + | |
| 39039 | + // 2. Unset request’s reload-navigation flag. | |
| 39040 | + request.reloadNavigation = false | |
| 39041 | + | |
| 39042 | + // 3. Unset request’s history-navigation flag. | |
| 39043 | + request.historyNavigation = false | |
| 39044 | + | |
| 39045 | + // 4. Set request’s origin to "client". | |
| 39046 | + request.origin = 'client' | |
| 39047 | + | |
| 39048 | + // 5. Set request’s referrer to "client" | |
| 39049 | + request.referrer = 'client' | |
| 39050 | + | |
| 39051 | + // 6. Set request’s referrer policy to the empty string. | |
| 39052 | + request.referrerPolicy = '' | |
| 39053 | + | |
| 39054 | + // 7. Set request’s URL to request’s current URL. | |
| 39055 | + request.url = request.urlList[request.urlList.length - 1] | |
| 39056 | + | |
| 39057 | + // 8. Set request’s URL list to « request’s URL ». | |
| 39058 | + request.urlList = [request.url] | |
| 39059 | + } | |
| 39060 | + | |
| 39061 | + // 14. If init["referrer"] exists, then: | |
| 39062 | + if (init.referrer !== undefined) { | |
| 39063 | + // 1. Let referrer be init["referrer"]. | |
| 39064 | + const referrer = init.referrer | |
| 39065 | + | |
| 39066 | + // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". | |
| 39067 | + if (referrer === '') { | |
| 39068 | + request.referrer = 'no-referrer' | |
| 39069 | + } else { | |
| 39070 | + // 1. Let parsedReferrer be the result of parsing referrer with | |
| 39071 | + // baseURL. | |
| 39072 | + // 2. If parsedReferrer is failure, then throw a TypeError. | |
| 39073 | + let parsedReferrer | |
| 39074 | + try { | |
| 39075 | + parsedReferrer = new URL(referrer, baseUrl) | |
| 39076 | + } catch (err) { | |
| 39077 | + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) | |
| 39078 | + } | |
| 39079 | + | |
| 39080 | + // 3. If one of the following is true | |
| 39081 | + // - parsedReferrer’s scheme is "about" and path is the string "client" | |
| 39082 | + // - parsedReferrer’s origin is not same origin with origin | |
| 39083 | + // then set request’s referrer to "client". | |
| 39084 | + if ( | |
| 39085 | + (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || | |
| 39086 | + (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) | |
| 39087 | + ) { | |
| 39088 | + request.referrer = 'client' | |
| 39089 | + } else { | |
| 39090 | + // 4. Otherwise, set request’s referrer to parsedReferrer. | |
| 39091 | + request.referrer = parsedReferrer | |
| 39092 | + } | |
| 39093 | + } | |
| 39094 | + } | |
| 39095 | + | |
| 39096 | + // 15. If init["referrerPolicy"] exists, then set request’s referrer policy | |
| 39097 | + // to it. | |
| 39098 | + if (init.referrerPolicy !== undefined) { | |
| 39099 | + request.referrerPolicy = init.referrerPolicy | |
| 39100 | + } | |
| 39101 | + | |
| 39102 | + // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. | |
| 39103 | + let mode | |
| 39104 | + if (init.mode !== undefined) { | |
| 39105 | + mode = init.mode | |
| 39106 | + } else { | |
| 39107 | + mode = fallbackMode | |
| 39108 | + } | |
| 39109 | + | |
| 39110 | + // 17. If mode is "navigate", then throw a TypeError. | |
| 39111 | + if (mode === 'navigate') { | |
| 39112 | + throw webidl.errors.exception({ | |
| 39113 | + header: 'Request constructor', | |
| 39114 | + message: 'invalid request mode navigate.' | |
| 39115 | + }) | |
| 39116 | + } | |
| 39117 | + | |
| 39118 | + // 18. If mode is non-null, set request’s mode to mode. | |
| 39119 | + if (mode != null) { | |
| 39120 | + request.mode = mode | |
| 39121 | + } | |
| 39122 | + | |
| 39123 | + // 19. If init["credentials"] exists, then set request’s credentials mode | |
| 39124 | + // to it. | |
| 39125 | + if (init.credentials !== undefined) { | |
| 39126 | + request.credentials = init.credentials | |
| 39127 | + } | |
| 39128 | + | |
| 39129 | + // 18. If init["cache"] exists, then set request’s cache mode to it. | |
| 39130 | + if (init.cache !== undefined) { | |
| 39131 | + request.cache = init.cache | |
| 39132 | + } | |
| 39133 | + | |
| 39134 | + // 21. If request’s cache mode is "only-if-cached" and request’s mode is | |
| 39135 | + // not "same-origin", then throw a TypeError. | |
| 39136 | + if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { | |
| 39137 | + throw new TypeError( | |
| 39138 | + "'only-if-cached' can be set only with 'same-origin' mode" | |
| 39139 | + ) | |
| 39140 | + } | |
| 39141 | + | |
| 39142 | + // 22. If init["redirect"] exists, then set request’s redirect mode to it. | |
| 39143 | + if (init.redirect !== undefined) { | |
| 39144 | + request.redirect = init.redirect | |
| 39145 | + } | |
| 39146 | + | |
| 39147 | + // 23. If init["integrity"] exists, then set request’s integrity metadata to it. | |
| 39148 | + if (init.integrity != null) { | |
| 39149 | + request.integrity = String(init.integrity) | |
| 39150 | + } | |
| 39151 | + | |
| 39152 | + // 24. If init["keepalive"] exists, then set request’s keepalive to it. | |
| 39153 | + if (init.keepalive !== undefined) { | |
| 39154 | + request.keepalive = Boolean(init.keepalive) | |
| 39155 | + } | |
| 39156 | + | |
| 39157 | + // 25. If init["method"] exists, then: | |
| 39158 | + if (init.method !== undefined) { | |
| 39159 | + // 1. Let method be init["method"]. | |
| 39160 | + let method = init.method | |
| 39161 | + | |
| 39162 | + // 2. If method is not a method or method is a forbidden method, then | |
| 39163 | + // throw a TypeError. | |
| 39164 | + if (!isValidHTTPToken(method)) { | |
| 39165 | + throw new TypeError(`'${method}' is not a valid HTTP method.`) | |
| 39166 | + } | |
| 39167 | + | |
| 39168 | + if (forbiddenMethodsSet.has(method.toUpperCase())) { | |
| 39169 | + throw new TypeError(`'${method}' HTTP method is unsupported.`) | |
| 39170 | + } | |
| 39171 | + | |
| 39172 | + // 3. Normalize method. | |
| 39173 | + method = normalizeMethodRecord[method] ?? normalizeMethod(method) | |
| 39174 | + | |
| 39175 | + // 4. Set request’s method to method. | |
| 39176 | + request.method = method | |
| 39177 | + } | |
| 39178 | + | |
| 39179 | + // 26. If init["signal"] exists, then set signal to it. | |
| 39180 | + if (init.signal !== undefined) { | |
| 39181 | + signal = init.signal | |
| 39182 | + } | |
| 39183 | + | |
| 39184 | + // 27. Set this’s request to request. | |
| 39185 | + this[kState] = request | |
| 39186 | + | |
| 39187 | + // 28. Set this’s signal to a new AbortSignal object with this’s relevant | |
| 39188 | + // Realm. | |
| 39189 | + // TODO: could this be simplified with AbortSignal.any | |
| 39190 | + // (https://dom.spec.whatwg.org/#dom-abortsignal-any) | |
| 39191 | + const ac = new AbortController() | |
| 39192 | + this[kSignal] = ac.signal | |
| 39193 | + this[kSignal][kRealm] = this[kRealm] | |
| 39194 | + | |
| 39195 | + // 29. If signal is not null, then make this’s signal follow signal. | |
| 39196 | + if (signal != null) { | |
| 39197 | + if ( | |
| 39198 | + !signal || | |
| 39199 | + typeof signal.aborted !== 'boolean' || | |
| 39200 | + typeof signal.addEventListener !== 'function' | |
| 39201 | + ) { | |
| 39202 | + throw new TypeError( | |
| 39203 | + "Failed to construct 'Request': member signal is not of type AbortSignal." | |
| 39204 | + ) | |
| 39205 | + } | |
| 39206 | + | |
| 39207 | + if (signal.aborted) { | |
| 39208 | + ac.abort(signal.reason) | |
| 39209 | + } else { | |
| 39210 | + // Keep a strong ref to ac while request object | |
| 39211 | + // is alive. This is needed to prevent AbortController | |
| 39212 | + // from being prematurely garbage collected. | |
| 39213 | + // See, https://github.com/nodejs/undici/issues/1926. | |
| 39214 | + this[kAbortController] = ac | |
| 39215 | + | |
| 39216 | + const acRef = new WeakRef(ac) | |
| 39217 | + const abort = function () { | |
| 39218 | + const ac = acRef.deref() | |
| 39219 | + if (ac !== undefined) { | |
| 39220 | + ac.abort(this.reason) | |
| 39221 | + } | |
| 39222 | + } | |
| 39223 | + | |
| 39224 | + // Third-party AbortControllers may not work with these. | |
| 39225 | + // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. | |
| 39226 | + try { | |
| 39227 | + // If the max amount of listeners is equal to the default, increase it | |
| 39228 | + // This is only available in node >= v19.9.0 | |
| 39229 | + if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { | |
| 39230 | + setMaxListeners(100, signal) | |
| 39231 | + } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { | |
| 39232 | + setMaxListeners(100, signal) | |
| 39233 | + } | |
| 39234 | + } catch {} | |
| 39235 | + | |
| 39236 | + util.addAbortListener(signal, abort) | |
| 39237 | + requestFinalizer.register(ac, { signal, abort }) | |
| 39238 | + } | |
| 39239 | + } | |
| 39240 | + | |
| 39241 | + // 30. Set this’s headers to a new Headers object with this’s relevant | |
| 39242 | + // Realm, whose header list is request’s header list and guard is | |
| 39243 | + // "request". | |
| 39244 | + this[kHeaders] = new Headers(kConstruct) | |
| 39245 | + this[kHeaders][kHeadersList] = request.headersList | |
| 39246 | + this[kHeaders][kGuard] = 'request' | |
| 39247 | + this[kHeaders][kRealm] = this[kRealm] | |
| 39248 | + | |
| 39249 | + // 31. If this’s request’s mode is "no-cors", then: | |
| 39250 | + if (mode === 'no-cors') { | |
| 39251 | + // 1. If this’s request’s method is not a CORS-safelisted method, | |
| 39252 | + // then throw a TypeError. | |
| 39253 | + if (!corsSafeListedMethodsSet.has(request.method)) { | |
| 39254 | + throw new TypeError( | |
| 39255 | + `'${request.method} is unsupported in no-cors mode.` | |
| 39256 | + ) | |
| 39257 | + } | |
| 39258 | + | |
| 39259 | + // 2. Set this’s headers’s guard to "request-no-cors". | |
| 39260 | + this[kHeaders][kGuard] = 'request-no-cors' | |
| 39261 | + } | |
| 39262 | + | |
| 39263 | + // 32. If init is not empty, then: | |
| 39264 | + if (initHasKey) { | |
| 39265 | + /** @type {HeadersList} */ | |
| 39266 | + const headersList = this[kHeaders][kHeadersList] | |
| 39267 | + // 1. Let headers be a copy of this’s headers and its associated header | |
| 39268 | + // list. | |
| 39269 | + // 2. If init["headers"] exists, then set headers to init["headers"]. | |
| 39270 | + const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) | |
| 39271 | + | |
| 39272 | + // 3. Empty this’s headers’s header list. | |
| 39273 | + headersList.clear() | |
| 39274 | + | |
| 39275 | + // 4. If headers is a Headers object, then for each header in its header | |
| 39276 | + // list, append header’s name/header’s value to this’s headers. | |
| 39277 | + if (headers instanceof HeadersList) { | |
| 39278 | + for (const [key, val] of headers) { | |
| 39279 | + headersList.append(key, val) | |
| 39280 | + } | |
| 39281 | + // Note: Copy the `set-cookie` meta-data. | |
| 39282 | + headersList.cookies = headers.cookies | |
| 39283 | + } else { | |
| 39284 | + // 5. Otherwise, fill this’s headers with headers. | |
| 39285 | + fillHeaders(this[kHeaders], headers) | |
| 39286 | + } | |
| 39287 | + } | |
| 39288 | + | |
| 39289 | + // 33. Let inputBody be input’s request’s body if input is a Request | |
| 39290 | + // object; otherwise null. | |
| 39291 | + const inputBody = input instanceof Request ? input[kState].body : null | |
| 39292 | + | |
| 39293 | + // 34. If either init["body"] exists and is non-null or inputBody is | |
| 39294 | + // non-null, and request’s method is `GET` or `HEAD`, then throw a | |
| 39295 | + // TypeError. | |
| 39296 | + if ( | |
| 39297 | + (init.body != null || inputBody != null) && | |
| 39298 | + (request.method === 'GET' || request.method === 'HEAD') | |
| 39299 | + ) { | |
| 39300 | + throw new TypeError('Request with GET/HEAD method cannot have body.') | |
| 39301 | + } | |
| 39302 | + | |
| 39303 | + // 35. Let initBody be null. | |
| 39304 | + let initBody = null | |
| 39305 | + | |
| 39306 | + // 36. If init["body"] exists and is non-null, then: | |
| 39307 | + if (init.body != null) { | |
| 39308 | + // 1. Let Content-Type be null. | |
| 39309 | + // 2. Set initBody and Content-Type to the result of extracting | |
| 39310 | + // init["body"], with keepalive set to request’s keepalive. | |
| 39311 | + const [extractedBody, contentType] = extractBody( | |
| 39312 | + init.body, | |
| 39313 | + request.keepalive | |
| 39314 | + ) | |
| 39315 | + initBody = extractedBody | |
| 39316 | + | |
| 39317 | + // 3, If Content-Type is non-null and this’s headers’s header list does | |
| 39318 | + // not contain `Content-Type`, then append `Content-Type`/Content-Type to | |
| 39319 | + // this’s headers. | |
| 39320 | + if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { | |
| 39321 | + this[kHeaders].append('content-type', contentType) | |
| 39322 | + } | |
| 39323 | + } | |
| 39324 | + | |
| 39325 | + // 37. Let inputOrInitBody be initBody if it is non-null; otherwise | |
| 39326 | + // inputBody. | |
| 39327 | + const inputOrInitBody = initBody ?? inputBody | |
| 39328 | + | |
| 39329 | + // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is | |
| 39330 | + // null, then: | |
| 39331 | + if (inputOrInitBody != null && inputOrInitBody.source == null) { | |
| 39332 | + // 1. If initBody is non-null and init["duplex"] does not exist, | |
| 39333 | + // then throw a TypeError. | |
| 39334 | + if (initBody != null && init.duplex == null) { | |
| 39335 | + throw new TypeError('RequestInit: duplex option is required when sending a body.') | |
| 39336 | + } | |
| 39337 | + | |
| 39338 | + // 2. If this’s request’s mode is neither "same-origin" nor "cors", | |
| 39339 | + // then throw a TypeError. | |
| 39340 | + if (request.mode !== 'same-origin' && request.mode !== 'cors') { | |
| 39341 | + throw new TypeError( | |
| 39342 | + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' | |
| 39343 | + ) | |
| 39344 | + } | |
| 39345 | + | |
| 39346 | + // 3. Set this’s request’s use-CORS-preflight flag. | |
| 39347 | + request.useCORSPreflightFlag = true | |
| 39348 | + } | |
| 39349 | + | |
| 39350 | + // 39. Let finalBody be inputOrInitBody. | |
| 39351 | + let finalBody = inputOrInitBody | |
| 39352 | + | |
| 39353 | + // 40. If initBody is null and inputBody is non-null, then: | |
| 39354 | + if (initBody == null && inputBody != null) { | |
| 39355 | + // 1. If input is unusable, then throw a TypeError. | |
| 39356 | + if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { | |
| 39357 | + throw new TypeError( | |
| 39358 | + 'Cannot construct a Request with a Request object that has already been used.' | |
| 39359 | + ) | |
| 39360 | + } | |
| 39361 | + | |
| 39362 | + // 2. Set finalBody to the result of creating a proxy for inputBody. | |
| 39363 | + if (!TransformStream) { | |
| 39364 | + TransformStream = (__nccwpck_require__(3774).TransformStream) | |
| 39365 | + } | |
| 39366 | + | |
| 39367 | + // https://streams.spec.whatwg.org/#readablestream-create-a-proxy | |
| 39368 | + const identityTransform = new TransformStream() | |
| 39369 | + inputBody.stream.pipeThrough(identityTransform) | |
| 39370 | + finalBody = { | |
| 39371 | + source: inputBody.source, | |
| 39372 | + length: inputBody.length, | |
| 39373 | + stream: identityTransform.readable | |
| 39374 | + } | |
| 39375 | + } | |
| 39376 | + | |
| 39377 | + // 41. Set this’s request’s body to finalBody. | |
| 39378 | + this[kState].body = finalBody | |
| 39379 | + } | |
| 39380 | + | |
| 39381 | + // Returns request’s HTTP method, which is "GET" by default. | |
| 39382 | + get method () { | |
| 39383 | + webidl.brandCheck(this, Request) | |
| 39384 | + | |
| 39385 | + // The method getter steps are to return this’s request’s method. | |
| 39386 | + return this[kState].method | |
| 39387 | + } | |
| 39388 | + | |
| 39389 | + // Returns the URL of request as a string. | |
| 39390 | + get url () { | |
| 39391 | + webidl.brandCheck(this, Request) | |
| 39392 | + | |
| 39393 | + // The url getter steps are to return this’s request’s URL, serialized. | |
| 39394 | + return URLSerializer(this[kState].url) | |
| 39395 | + } | |
| 39396 | + | |
| 39397 | + // Returns a Headers object consisting of the headers associated with request. | |
| 39398 | + // Note that headers added in the network layer by the user agent will not | |
| 39399 | + // be accounted for in this object, e.g., the "Host" header. | |
| 39400 | + get headers () { | |
| 39401 | + webidl.brandCheck(this, Request) | |
| 39402 | + | |
| 39403 | + // The headers getter steps are to return this’s headers. | |
| 39404 | + return this[kHeaders] | |
| 39405 | + } | |
| 39406 | + | |
| 39407 | + // Returns the kind of resource requested by request, e.g., "document" | |
| 39408 | + // or "script". | |
| 39409 | + get destination () { | |
| 39410 | + webidl.brandCheck(this, Request) | |
| 39411 | + | |
| 39412 | + // The destination getter are to return this’s request’s destination. | |
| 39413 | + return this[kState].destination | |
| 39414 | + } | |
| 39415 | + | |
| 39416 | + // Returns the referrer of request. Its value can be a same-origin URL if | |
| 39417 | + // explicitly set in init, the empty string to indicate no referrer, and | |
| 39418 | + // "about:client" when defaulting to the global’s default. This is used | |
| 39419 | + // during fetching to determine the value of the `Referer` header of the | |
| 39420 | + // request being made. | |
| 39421 | + get referrer () { | |
| 39422 | + webidl.brandCheck(this, Request) | |
| 39423 | + | |
| 39424 | + // 1. If this’s request’s referrer is "no-referrer", then return the | |
| 39425 | + // empty string. | |
| 39426 | + if (this[kState].referrer === 'no-referrer') { | |
| 39427 | + return '' | |
| 39428 | + } | |
| 39429 | + | |
| 39430 | + // 2. If this’s request’s referrer is "client", then return | |
| 39431 | + // "about:client". | |
| 39432 | + if (this[kState].referrer === 'client') { | |
| 39433 | + return 'about:client' | |
| 39434 | + } | |
| 39435 | + | |
| 39436 | + // Return this’s request’s referrer, serialized. | |
| 39437 | + return this[kState].referrer.toString() | |
| 39438 | + } | |
| 39439 | + | |
| 39440 | + // Returns the referrer policy associated with request. | |
| 39441 | + // This is used during fetching to compute the value of the request’s | |
| 39442 | + // referrer. | |
| 39443 | + get referrerPolicy () { | |
| 39444 | + webidl.brandCheck(this, Request) | |
| 39445 | + | |
| 39446 | + // The referrerPolicy getter steps are to return this’s request’s referrer policy. | |
| 39447 | + return this[kState].referrerPolicy | |
| 39448 | + } | |
| 39449 | + | |
| 39450 | + // Returns the mode associated with request, which is a string indicating | |
| 39451 | + // whether the request will use CORS, or will be restricted to same-origin | |
| 39452 | + // URLs. | |
| 39453 | + get mode () { | |
| 39454 | + webidl.brandCheck(this, Request) | |
| 39455 | + | |
| 39456 | + // The mode getter steps are to return this’s request’s mode. | |
| 39457 | + return this[kState].mode | |
| 39458 | + } | |
| 39459 | + | |
| 39460 | + // Returns the credentials mode associated with request, | |
| 39461 | + // which is a string indicating whether credentials will be sent with the | |
| 39462 | + // request always, never, or only when sent to a same-origin URL. | |
| 39463 | + get credentials () { | |
| 39464 | + // The credentials getter steps are to return this’s request’s credentials mode. | |
| 39465 | + return this[kState].credentials | |
| 39466 | + } | |
| 39467 | + | |
| 39468 | + // Returns the cache mode associated with request, | |
| 39469 | + // which is a string indicating how the request will | |
| 39470 | + // interact with the browser’s cache when fetching. | |
| 39471 | + get cache () { | |
| 39472 | + webidl.brandCheck(this, Request) | |
| 39473 | + | |
| 39474 | + // The cache getter steps are to return this’s request’s cache mode. | |
| 39475 | + return this[kState].cache | |
| 39476 | + } | |
| 39477 | + | |
| 39478 | + // Returns the redirect mode associated with request, | |
| 39479 | + // which is a string indicating how redirects for the | |
| 39480 | + // request will be handled during fetching. A request | |
| 39481 | + // will follow redirects by default. | |
| 39482 | + get redirect () { | |
| 39483 | + webidl.brandCheck(this, Request) | |
| 39484 | + | |
| 39485 | + // The redirect getter steps are to return this’s request’s redirect mode. | |
| 39486 | + return this[kState].redirect | |
| 39487 | + } | |
| 39488 | + | |
| 39489 | + // Returns request’s subresource integrity metadata, which is a | |
| 39490 | + // cryptographic hash of the resource being fetched. Its value | |
| 39491 | + // consists of multiple hashes separated by whitespace. [SRI] | |
| 39492 | + get integrity () { | |
| 39493 | + webidl.brandCheck(this, Request) | |
| 39494 | + | |
| 39495 | + // The integrity getter steps are to return this’s request’s integrity | |
| 39496 | + // metadata. | |
| 39497 | + return this[kState].integrity | |
| 39498 | + } | |
| 39499 | + | |
| 39500 | + // Returns a boolean indicating whether or not request can outlive the | |
| 39501 | + // global in which it was created. | |
| 39502 | + get keepalive () { | |
| 39503 | + webidl.brandCheck(this, Request) | |
| 39504 | + | |
| 39505 | + // The keepalive getter steps are to return this’s request’s keepalive. | |
| 39506 | + return this[kState].keepalive | |
| 39507 | + } | |
| 39508 | + | |
| 39509 | + // Returns a boolean indicating whether or not request is for a reload | |
| 39510 | + // navigation. | |
| 39511 | + get isReloadNavigation () { | |
| 39512 | + webidl.brandCheck(this, Request) | |
| 39513 | + | |
| 39514 | + // The isReloadNavigation getter steps are to return true if this’s | |
| 39515 | + // request’s reload-navigation flag is set; otherwise false. | |
| 39516 | + return this[kState].reloadNavigation | |
| 39517 | + } | |
| 39518 | + | |
| 39519 | + // Returns a boolean indicating whether or not request is for a history | |
| 39520 | + // navigation (a.k.a. back-foward navigation). | |
| 39521 | + get isHistoryNavigation () { | |
| 39522 | + webidl.brandCheck(this, Request) | |
| 39523 | + | |
| 39524 | + // The isHistoryNavigation getter steps are to return true if this’s request’s | |
| 39525 | + // history-navigation flag is set; otherwise false. | |
| 39526 | + return this[kState].historyNavigation | |
| 39527 | + } | |
| 39528 | + | |
| 39529 | + // Returns the signal associated with request, which is an AbortSignal | |
| 39530 | + // object indicating whether or not request has been aborted, and its | |
| 39531 | + // abort event handler. | |
| 39532 | + get signal () { | |
| 39533 | + webidl.brandCheck(this, Request) | |
| 39534 | + | |
| 39535 | + // The signal getter steps are to return this’s signal. | |
| 39536 | + return this[kSignal] | |
| 39537 | + } | |
| 39538 | + | |
| 39539 | + get body () { | |
| 39540 | + webidl.brandCheck(this, Request) | |
| 39541 | + | |
| 39542 | + return this[kState].body ? this[kState].body.stream : null | |
| 39543 | + } | |
| 39544 | + | |
| 39545 | + get bodyUsed () { | |
| 39546 | + webidl.brandCheck(this, Request) | |
| 39547 | + | |
| 39548 | + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) | |
| 39549 | + } | |
| 39550 | + | |
| 39551 | + get duplex () { | |
| 39552 | + webidl.brandCheck(this, Request) | |
| 39553 | + | |
| 39554 | + return 'half' | |
| 39555 | + } | |
| 39556 | + | |
| 39557 | + // Returns a clone of request. | |
| 39558 | + clone () { | |
| 39559 | + webidl.brandCheck(this, Request) | |
| 39560 | + | |
| 39561 | + // 1. If this is unusable, then throw a TypeError. | |
| 39562 | + if (this.bodyUsed || this.body?.locked) { | |
| 39563 | + throw new TypeError('unusable') | |
| 39564 | + } | |
| 39565 | + | |
| 39566 | + // 2. Let clonedRequest be the result of cloning this’s request. | |
| 39567 | + const clonedRequest = cloneRequest(this[kState]) | |
| 39568 | + | |
| 39569 | + // 3. Let clonedRequestObject be the result of creating a Request object, | |
| 39570 | + // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. | |
| 39571 | + const clonedRequestObject = new Request(kConstruct) | |
| 39572 | + clonedRequestObject[kState] = clonedRequest | |
| 39573 | + clonedRequestObject[kRealm] = this[kRealm] | |
| 39574 | + clonedRequestObject[kHeaders] = new Headers(kConstruct) | |
| 39575 | + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList | |
| 39576 | + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] | |
| 39577 | + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] | |
| 39578 | + | |
| 39579 | + // 4. Make clonedRequestObject’s signal follow this’s signal. | |
| 39580 | + const ac = new AbortController() | |
| 39581 | + if (this.signal.aborted) { | |
| 39582 | + ac.abort(this.signal.reason) | |
| 39583 | + } else { | |
| 39584 | + util.addAbortListener( | |
| 39585 | + this.signal, | |
| 39586 | + () => { | |
| 39587 | + ac.abort(this.signal.reason) | |
| 39588 | + } | |
| 39589 | + ) | |
| 39590 | + } | |
| 39591 | + clonedRequestObject[kSignal] = ac.signal | |
| 39592 | + | |
| 39593 | + // 4. Return clonedRequestObject. | |
| 39594 | + return clonedRequestObject | |
| 39595 | + } | |
| 39596 | +} | |
| 39597 | + | |
| 39598 | +mixinBody(Request) | |
| 39599 | + | |
| 39600 | +function makeRequest (init) { | |
| 39601 | + // https://fetch.spec.whatwg.org/#requests | |
| 39602 | + const request = { | |
| 39603 | + method: 'GET', | |
| 39604 | + localURLsOnly: false, | |
| 39605 | + unsafeRequest: false, | |
| 39606 | + body: null, | |
| 39607 | + client: null, | |
| 39608 | + reservedClient: null, | |
| 39609 | + replacesClientId: '', | |
| 39610 | + window: 'client', | |
| 39611 | + keepalive: false, | |
| 39612 | + serviceWorkers: 'all', | |
| 39613 | + initiator: '', | |
| 39614 | + destination: '', | |
| 39615 | + priority: null, | |
| 39616 | + origin: 'client', | |
| 39617 | + policyContainer: 'client', | |
| 39618 | + referrer: 'client', | |
| 39619 | + referrerPolicy: '', | |
| 39620 | + mode: 'no-cors', | |
| 39621 | + useCORSPreflightFlag: false, | |
| 39622 | + credentials: 'same-origin', | |
| 39623 | + useCredentials: false, | |
| 39624 | + cache: 'default', | |
| 39625 | + redirect: 'follow', | |
| 39626 | + integrity: '', | |
| 39627 | + cryptoGraphicsNonceMetadata: '', | |
| 39628 | + parserMetadata: '', | |
| 39629 | + reloadNavigation: false, | |
| 39630 | + historyNavigation: false, | |
| 39631 | + userActivation: false, | |
| 39632 | + taintedOrigin: false, | |
| 39633 | + redirectCount: 0, | |
| 39634 | + responseTainting: 'basic', | |
| 39635 | + preventNoCacheCacheControlHeaderModification: false, | |
| 39636 | + done: false, | |
| 39637 | + timingAllowFailed: false, | |
| 39638 | + ...init, | |
| 39639 | + headersList: init.headersList | |
| 39640 | + ? new HeadersList(init.headersList) | |
| 39641 | + : new HeadersList() | |
| 39642 | + } | |
| 39643 | + request.url = request.urlList[0] | |
| 39644 | + return request | |
| 39645 | +} | |
| 39646 | + | |
| 39647 | +// https://fetch.spec.whatwg.org/#concept-request-clone | |
| 39648 | +function cloneRequest (request) { | |
| 39649 | + // To clone a request request, run these steps: | |
| 39650 | + | |
| 39651 | + // 1. Let newRequest be a copy of request, except for its body. | |
| 39652 | + const newRequest = makeRequest({ ...request, body: null }) | |
| 39653 | + | |
| 39654 | + // 2. If request’s body is non-null, set newRequest’s body to the | |
| 39655 | + // result of cloning request’s body. | |
| 39656 | + if (request.body != null) { | |
| 39657 | + newRequest.body = cloneBody(request.body) | |
| 39658 | + } | |
| 39659 | + | |
| 39660 | + // 3. Return newRequest. | |
| 39661 | + return newRequest | |
| 39662 | +} | |
| 39663 | + | |
| 39664 | +Object.defineProperties(Request.prototype, { | |
| 39665 | + method: kEnumerableProperty, | |
| 39666 | + url: kEnumerableProperty, | |
| 39667 | + headers: kEnumerableProperty, | |
| 39668 | + redirect: kEnumerableProperty, | |
| 39669 | + clone: kEnumerableProperty, | |
| 39670 | + signal: kEnumerableProperty, | |
| 39671 | + duplex: kEnumerableProperty, | |
| 39672 | + destination: kEnumerableProperty, | |
| 39673 | + body: kEnumerableProperty, | |
| 39674 | + bodyUsed: kEnumerableProperty, | |
| 39675 | + isHistoryNavigation: kEnumerableProperty, | |
| 39676 | + isReloadNavigation: kEnumerableProperty, | |
| 39677 | + keepalive: kEnumerableProperty, | |
| 39678 | + integrity: kEnumerableProperty, | |
| 39679 | + cache: kEnumerableProperty, | |
| 39680 | + credentials: kEnumerableProperty, | |
| 39681 | + attribute: kEnumerableProperty, | |
| 39682 | + referrerPolicy: kEnumerableProperty, | |
| 39683 | + referrer: kEnumerableProperty, | |
| 39684 | + mode: kEnumerableProperty, | |
| 39685 | + [Symbol.toStringTag]: { | |
| 39686 | + value: 'Request', | |
| 39687 | + configurable: true | |
| 39688 | + } | |
| 39689 | +}) | |
| 39690 | + | |
| 39691 | +webidl.converters.Request = webidl.interfaceConverter( | |
| 39692 | + Request | |
| 39693 | +) | |
| 39694 | + | |
| 39695 | +// https://fetch.spec.whatwg.org/#requestinfo | |
| 39696 | +webidl.converters.RequestInfo = function (V) { | |
| 39697 | + if (typeof V === 'string') { | |
| 39698 | + return webidl.converters.USVString(V) | |
| 39699 | + } | |
| 39700 | + | |
| 39701 | + if (V instanceof Request) { | |
| 39702 | + return webidl.converters.Request(V) | |
| 39703 | + } | |
| 39704 | + | |
| 39705 | + return webidl.converters.USVString(V) | |
| 39706 | +} | |
| 39707 | + | |
| 39708 | +webidl.converters.AbortSignal = webidl.interfaceConverter( | |
| 39709 | + AbortSignal | |
| 39710 | +) | |
| 39711 | + | |
| 39712 | +// https://fetch.spec.whatwg.org/#requestinit | |
| 39713 | +webidl.converters.RequestInit = webidl.dictionaryConverter([ | |
| 39714 | + { | |
| 39715 | + key: 'method', | |
| 39716 | + converter: webidl.converters.ByteString | |
| 39717 | + }, | |
| 39718 | + { | |
| 39719 | + key: 'headers', | |
| 39720 | + converter: webidl.converters.HeadersInit | |
| 39721 | + }, | |
| 39722 | + { | |
| 39723 | + key: 'body', | |
| 39724 | + converter: webidl.nullableConverter( | |
| 39725 | + webidl.converters.BodyInit | |
| 39726 | + ) | |
| 39727 | + }, | |
| 39728 | + { | |
| 39729 | + key: 'referrer', | |
| 39730 | + converter: webidl.converters.USVString | |
| 39731 | + }, | |
| 39732 | + { | |
| 39733 | + key: 'referrerPolicy', | |
| 39734 | + converter: webidl.converters.DOMString, | |
| 39735 | + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy | |
| 39736 | + allowedValues: referrerPolicy | |
| 39737 | + }, | |
| 39738 | + { | |
| 39739 | + key: 'mode', | |
| 39740 | + converter: webidl.converters.DOMString, | |
| 39741 | + // https://fetch.spec.whatwg.org/#concept-request-mode | |
| 39742 | + allowedValues: requestMode | |
| 39743 | + }, | |
| 39744 | + { | |
| 39745 | + key: 'credentials', | |
| 39746 | + converter: webidl.converters.DOMString, | |
| 39747 | + // https://fetch.spec.whatwg.org/#requestcredentials | |
| 39748 | + allowedValues: requestCredentials | |
| 39749 | + }, | |
| 39750 | + { | |
| 39751 | + key: 'cache', | |
| 39752 | + converter: webidl.converters.DOMString, | |
| 39753 | + // https://fetch.spec.whatwg.org/#requestcache | |
| 39754 | + allowedValues: requestCache | |
| 39755 | + }, | |
| 39756 | + { | |
| 39757 | + key: 'redirect', | |
| 39758 | + converter: webidl.converters.DOMString, | |
| 39759 | + // https://fetch.spec.whatwg.org/#requestredirect | |
| 39760 | + allowedValues: requestRedirect | |
| 39761 | + }, | |
| 39762 | + { | |
| 39763 | + key: 'integrity', | |
| 39764 | + converter: webidl.converters.DOMString | |
| 39765 | + }, | |
| 39766 | + { | |
| 39767 | + key: 'keepalive', | |
| 39768 | + converter: webidl.converters.boolean | |
| 39769 | + }, | |
| 39770 | + { | |
| 39771 | + key: 'signal', | |
| 39772 | + converter: webidl.nullableConverter( | |
| 39773 | + (signal) => webidl.converters.AbortSignal( | |
| 39774 | + signal, | |
| 39775 | + { strict: false } | |
| 39776 | + ) | |
| 39777 | + ) | |
| 39778 | + }, | |
| 39779 | + { | |
| 39780 | + key: 'window', | |
| 39781 | + converter: webidl.converters.any | |
| 39782 | + }, | |
| 39783 | + { | |
| 39784 | + key: 'duplex', | |
| 39785 | + converter: webidl.converters.DOMString, | |
| 39786 | + allowedValues: requestDuplex | |
| 39787 | + } | |
| 39788 | +]) | |
| 39789 | + | |
| 39790 | +module.exports = { Request, makeRequest } | |
| 39791 | + | |
| 39792 | + | |
| 39793 | +/***/ }), | |
| 39794 | + | |
| 39795 | +/***/ 8676: | |
| 39796 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 39797 | + | |
| 39798 | +"use strict"; | |
| 39799 | + | |
| 39800 | + | |
| 39801 | +const { Headers, HeadersList, fill } = __nccwpck_require__(6349) | |
| 39802 | +const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(8923) | |
| 39803 | +const util = __nccwpck_require__(3440) | |
| 39804 | +const { kEnumerableProperty } = util | |
| 39805 | +const { | |
| 39806 | + isValidReasonPhrase, | |
| 39807 | + isCancelled, | |
| 39808 | + isAborted, | |
| 39809 | + isBlobLike, | |
| 39810 | + serializeJavascriptValueToJSONString, | |
| 39811 | + isErrorLike, | |
| 39812 | + isomorphicEncode | |
| 39813 | +} = __nccwpck_require__(5523) | |
| 39814 | +const { | |
| 39815 | + redirectStatusSet, | |
| 39816 | + nullBodyStatus, | |
| 39817 | + DOMException | |
| 39818 | +} = __nccwpck_require__(7326) | |
| 39819 | +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) | |
| 39820 | +const { webidl } = __nccwpck_require__(4222) | |
| 39821 | +const { FormData } = __nccwpck_require__(3073) | |
| 39822 | +const { getGlobalOrigin } = __nccwpck_require__(5628) | |
| 39823 | +const { URLSerializer } = __nccwpck_require__(4322) | |
| 39824 | +const { kHeadersList, kConstruct } = __nccwpck_require__(6443) | |
| 39825 | +const assert = __nccwpck_require__(2613) | |
| 39826 | +const { types } = __nccwpck_require__(9023) | |
| 39827 | + | |
| 39828 | +const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(3774).ReadableStream) | |
| 39829 | +const textEncoder = new TextEncoder('utf-8') | |
| 39830 | + | |
| 39831 | +// https://fetch.spec.whatwg.org/#response-class | |
| 39832 | +class Response { | |
| 39833 | + // Creates network error Response. | |
| 39834 | + static error () { | |
| 39835 | + // TODO | |
| 39836 | + const relevantRealm = { settingsObject: {} } | |
| 39837 | + | |
| 39838 | + // The static error() method steps are to return the result of creating a | |
| 39839 | + // Response object, given a new network error, "immutable", and this’s | |
| 39840 | + // relevant Realm. | |
| 39841 | + const responseObject = new Response() | |
| 39842 | + responseObject[kState] = makeNetworkError() | |
| 39843 | + responseObject[kRealm] = relevantRealm | |
| 39844 | + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList | |
| 39845 | + responseObject[kHeaders][kGuard] = 'immutable' | |
| 39846 | + responseObject[kHeaders][kRealm] = relevantRealm | |
| 39847 | + return responseObject | |
| 39848 | + } | |
| 39849 | + | |
| 39850 | + // https://fetch.spec.whatwg.org/#dom-response-json | |
| 39851 | + static json (data, init = {}) { | |
| 39852 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) | |
| 39853 | + | |
| 39854 | + if (init !== null) { | |
| 39855 | + init = webidl.converters.ResponseInit(init) | |
| 39856 | + } | |
| 39857 | + | |
| 39858 | + // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. | |
| 39859 | + const bytes = textEncoder.encode( | |
| 39860 | + serializeJavascriptValueToJSONString(data) | |
| 39861 | + ) | |
| 39862 | + | |
| 39863 | + // 2. Let body be the result of extracting bytes. | |
| 39864 | + const body = extractBody(bytes) | |
| 39865 | + | |
| 39866 | + // 3. Let responseObject be the result of creating a Response object, given a new response, | |
| 39867 | + // "response", and this’s relevant Realm. | |
| 39868 | + const relevantRealm = { settingsObject: {} } | |
| 39869 | + const responseObject = new Response() | |
| 39870 | + responseObject[kRealm] = relevantRealm | |
| 39871 | + responseObject[kHeaders][kGuard] = 'response' | |
| 39872 | + responseObject[kHeaders][kRealm] = relevantRealm | |
| 39873 | + | |
| 39874 | + // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). | |
| 39875 | + initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) | |
| 39876 | + | |
| 39877 | + // 5. Return responseObject. | |
| 39878 | + return responseObject | |
| 39879 | + } | |
| 39880 | + | |
| 39881 | + // Creates a redirect Response that redirects to url with status status. | |
| 39882 | + static redirect (url, status = 302) { | |
| 39883 | + const relevantRealm = { settingsObject: {} } | |
| 39884 | + | |
| 39885 | + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) | |
| 39886 | + | |
| 39887 | + url = webidl.converters.USVString(url) | |
| 39888 | + status = webidl.converters['unsigned short'](status) | |
| 39889 | + | |
| 39890 | + // 1. Let parsedURL be the result of parsing url with current settings | |
| 39891 | + // object’s API base URL. | |
| 39892 | + // 2. If parsedURL is failure, then throw a TypeError. | |
| 39893 | + // TODO: base-URL? | |
| 39894 | + let parsedURL | |
| 39895 | + try { | |
| 39896 | + parsedURL = new URL(url, getGlobalOrigin()) | |
| 39897 | + } catch (err) { | |
| 39898 | + throw Object.assign(new TypeError('Failed to parse URL from ' + url), { | |
| 39899 | + cause: err | |
| 39900 | + }) | |
| 39901 | + } | |
| 39902 | + | |
| 39903 | + // 3. If status is not a redirect status, then throw a RangeError. | |
| 39904 | + if (!redirectStatusSet.has(status)) { | |
| 39905 | + throw new RangeError('Invalid status code ' + status) | |
| 39906 | + } | |
| 39907 | + | |
| 39908 | + // 4. Let responseObject be the result of creating a Response object, | |
| 39909 | + // given a new response, "immutable", and this’s relevant Realm. | |
| 39910 | + const responseObject = new Response() | |
| 39911 | + responseObject[kRealm] = relevantRealm | |
| 39912 | + responseObject[kHeaders][kGuard] = 'immutable' | |
| 39913 | + responseObject[kHeaders][kRealm] = relevantRealm | |
| 39914 | + | |
| 39915 | + // 5. Set responseObject’s response’s status to status. | |
| 39916 | + responseObject[kState].status = status | |
| 39917 | + | |
| 39918 | + // 6. Let value be parsedURL, serialized and isomorphic encoded. | |
| 39919 | + const value = isomorphicEncode(URLSerializer(parsedURL)) | |
| 39920 | + | |
| 39921 | + // 7. Append `Location`/value to responseObject’s response’s header list. | |
| 39922 | + responseObject[kState].headersList.append('location', value) | |
| 39923 | + | |
| 39924 | + // 8. Return responseObject. | |
| 39925 | + return responseObject | |
| 39926 | + } | |
| 39927 | + | |
| 39928 | + // https://fetch.spec.whatwg.org/#dom-response | |
| 39929 | + constructor (body = null, init = {}) { | |
| 39930 | + if (body !== null) { | |
| 39931 | + body = webidl.converters.BodyInit(body) | |
| 39932 | + } | |
| 39933 | + | |
| 39934 | + init = webidl.converters.ResponseInit(init) | |
| 39935 | + | |
| 39936 | + // TODO | |
| 39937 | + this[kRealm] = { settingsObject: {} } | |
| 39938 | + | |
| 39939 | + // 1. Set this’s response to a new response. | |
| 39940 | + this[kState] = makeResponse({}) | |
| 39941 | + | |
| 39942 | + // 2. Set this’s headers to a new Headers object with this’s relevant | |
| 39943 | + // Realm, whose header list is this’s response’s header list and guard | |
| 39944 | + // is "response". | |
| 39945 | + this[kHeaders] = new Headers(kConstruct) | |
| 39946 | + this[kHeaders][kGuard] = 'response' | |
| 39947 | + this[kHeaders][kHeadersList] = this[kState].headersList | |
| 39948 | + this[kHeaders][kRealm] = this[kRealm] | |
| 39949 | + | |
| 39950 | + // 3. Let bodyWithType be null. | |
| 39951 | + let bodyWithType = null | |
| 39952 | + | |
| 39953 | + // 4. If body is non-null, then set bodyWithType to the result of extracting body. | |
| 39954 | + if (body != null) { | |
| 39955 | + const [extractedBody, type] = extractBody(body) | |
| 39956 | + bodyWithType = { body: extractedBody, type } | |
| 39957 | + } | |
| 39958 | + | |
| 39959 | + // 5. Perform initialize a response given this, init, and bodyWithType. | |
| 39960 | + initializeResponse(this, init, bodyWithType) | |
| 39961 | + } | |
| 39962 | + | |
| 39963 | + // Returns response’s type, e.g., "cors". | |
| 39964 | + get type () { | |
| 39965 | + webidl.brandCheck(this, Response) | |
| 39966 | + | |
| 39967 | + // The type getter steps are to return this’s response’s type. | |
| 39968 | + return this[kState].type | |
| 39969 | + } | |
| 39970 | + | |
| 39971 | + // Returns response’s URL, if it has one; otherwise the empty string. | |
| 39972 | + get url () { | |
| 39973 | + webidl.brandCheck(this, Response) | |
| 39974 | + | |
| 39975 | + const urlList = this[kState].urlList | |
| 39976 | + | |
| 39977 | + // The url getter steps are to return the empty string if this’s | |
| 39978 | + // response’s URL is null; otherwise this’s response’s URL, | |
| 39979 | + // serialized with exclude fragment set to true. | |
| 39980 | + const url = urlList[urlList.length - 1] ?? null | |
| 39981 | + | |
| 39982 | + if (url === null) { | |
| 39983 | + return '' | |
| 39984 | + } | |
| 39985 | + | |
| 39986 | + return URLSerializer(url, true) | |
| 39987 | + } | |
| 39988 | + | |
| 39989 | + // Returns whether response was obtained through a redirect. | |
| 39990 | + get redirected () { | |
| 39991 | + webidl.brandCheck(this, Response) | |
| 39992 | + | |
| 39993 | + // The redirected getter steps are to return true if this’s response’s URL | |
| 39994 | + // list has more than one item; otherwise false. | |
| 39995 | + return this[kState].urlList.length > 1 | |
| 39996 | + } | |
| 39997 | + | |
| 39998 | + // Returns response’s status. | |
| 39999 | + get status () { | |
| 40000 | + webidl.brandCheck(this, Response) | |
| 40001 | + | |
| 40002 | + // The status getter steps are to return this’s response’s status. | |
| 40003 | + return this[kState].status | |
| 40004 | + } | |
| 40005 | + | |
| 40006 | + // Returns whether response’s status is an ok status. | |
| 40007 | + get ok () { | |
| 40008 | + webidl.brandCheck(this, Response) | |
| 40009 | + | |
| 40010 | + // The ok getter steps are to return true if this’s response’s status is an | |
| 40011 | + // ok status; otherwise false. | |
| 40012 | + return this[kState].status >= 200 && this[kState].status <= 299 | |
| 40013 | + } | |
| 40014 | + | |
| 40015 | + // Returns response’s status message. | |
| 40016 | + get statusText () { | |
| 40017 | + webidl.brandCheck(this, Response) | |
| 40018 | + | |
| 40019 | + // The statusText getter steps are to return this’s response’s status | |
| 40020 | + // message. | |
| 40021 | + return this[kState].statusText | |
| 40022 | + } | |
| 40023 | + | |
| 40024 | + // Returns response’s headers as Headers. | |
| 40025 | + get headers () { | |
| 40026 | + webidl.brandCheck(this, Response) | |
| 40027 | + | |
| 40028 | + // The headers getter steps are to return this’s headers. | |
| 40029 | + return this[kHeaders] | |
| 40030 | + } | |
| 40031 | + | |
| 40032 | + get body () { | |
| 40033 | + webidl.brandCheck(this, Response) | |
| 40034 | + | |
| 40035 | + return this[kState].body ? this[kState].body.stream : null | |
| 40036 | + } | |
| 40037 | + | |
| 40038 | + get bodyUsed () { | |
| 40039 | + webidl.brandCheck(this, Response) | |
| 40040 | + | |
| 40041 | + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) | |
| 40042 | + } | |
| 40043 | + | |
| 40044 | + // Returns a clone of response. | |
| 40045 | + clone () { | |
| 40046 | + webidl.brandCheck(this, Response) | |
| 40047 | + | |
| 40048 | + // 1. If this is unusable, then throw a TypeError. | |
| 40049 | + if (this.bodyUsed || (this.body && this.body.locked)) { | |
| 40050 | + throw webidl.errors.exception({ | |
| 40051 | + header: 'Response.clone', | |
| 40052 | + message: 'Body has already been consumed.' | |
| 40053 | + }) | |
| 40054 | + } | |
| 40055 | + | |
| 40056 | + // 2. Let clonedResponse be the result of cloning this’s response. | |
| 40057 | + const clonedResponse = cloneResponse(this[kState]) | |
| 40058 | + | |
| 40059 | + // 3. Return the result of creating a Response object, given | |
| 40060 | + // clonedResponse, this’s headers’s guard, and this’s relevant Realm. | |
| 40061 | + const clonedResponseObject = new Response() | |
| 40062 | + clonedResponseObject[kState] = clonedResponse | |
| 40063 | + clonedResponseObject[kRealm] = this[kRealm] | |
| 40064 | + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList | |
| 40065 | + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] | |
| 40066 | + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] | |
| 40067 | + | |
| 40068 | + return clonedResponseObject | |
| 40069 | + } | |
| 40070 | +} | |
| 40071 | + | |
| 40072 | +mixinBody(Response) | |
| 40073 | + | |
| 40074 | +Object.defineProperties(Response.prototype, { | |
| 40075 | + type: kEnumerableProperty, | |
| 40076 | + url: kEnumerableProperty, | |
| 40077 | + status: kEnumerableProperty, | |
| 40078 | + ok: kEnumerableProperty, | |
| 40079 | + redirected: kEnumerableProperty, | |
| 40080 | + statusText: kEnumerableProperty, | |
| 40081 | + headers: kEnumerableProperty, | |
| 40082 | + clone: kEnumerableProperty, | |
| 40083 | + body: kEnumerableProperty, | |
| 40084 | + bodyUsed: kEnumerableProperty, | |
| 40085 | + [Symbol.toStringTag]: { | |
| 40086 | + value: 'Response', | |
| 40087 | + configurable: true | |
| 40088 | + } | |
| 40089 | +}) | |
| 40090 | + | |
| 40091 | +Object.defineProperties(Response, { | |
| 40092 | + json: kEnumerableProperty, | |
| 40093 | + redirect: kEnumerableProperty, | |
| 40094 | + error: kEnumerableProperty | |
| 40095 | +}) | |
| 40096 | + | |
| 40097 | +// https://fetch.spec.whatwg.org/#concept-response-clone | |
| 40098 | +function cloneResponse (response) { | |
| 40099 | + // To clone a response response, run these steps: | |
| 40100 | + | |
| 40101 | + // 1. If response is a filtered response, then return a new identical | |
| 40102 | + // filtered response whose internal response is a clone of response’s | |
| 40103 | + // internal response. | |
| 40104 | + if (response.internalResponse) { | |
| 40105 | + return filterResponse( | |
| 40106 | + cloneResponse(response.internalResponse), | |
| 40107 | + response.type | |
| 40108 | + ) | |
| 40109 | + } | |
| 40110 | + | |
| 40111 | + // 2. Let newResponse be a copy of response, except for its body. | |
| 40112 | + const newResponse = makeResponse({ ...response, body: null }) | |
| 40113 | + | |
| 40114 | + // 3. If response’s body is non-null, then set newResponse’s body to the | |
| 40115 | + // result of cloning response’s body. | |
| 40116 | + if (response.body != null) { | |
| 40117 | + newResponse.body = cloneBody(response.body) | |
| 40118 | + } | |
| 40119 | + | |
| 40120 | + // 4. Return newResponse. | |
| 40121 | + return newResponse | |
| 40122 | +} | |
| 40123 | + | |
| 40124 | +function makeResponse (init) { | |
| 40125 | + return { | |
| 40126 | + aborted: false, | |
| 40127 | + rangeRequested: false, | |
| 40128 | + timingAllowPassed: false, | |
| 40129 | + requestIncludesCredentials: false, | |
| 40130 | + type: 'default', | |
| 40131 | + status: 200, | |
| 40132 | + timingInfo: null, | |
| 40133 | + cacheState: '', | |
| 40134 | + statusText: '', | |
| 40135 | + ...init, | |
| 40136 | + headersList: init.headersList | |
| 40137 | + ? new HeadersList(init.headersList) | |
| 40138 | + : new HeadersList(), | |
| 40139 | + urlList: init.urlList ? [...init.urlList] : [] | |
| 40140 | + } | |
| 40141 | +} | |
| 40142 | + | |
| 40143 | +function makeNetworkError (reason) { | |
| 40144 | + const isError = isErrorLike(reason) | |
| 40145 | + return makeResponse({ | |
| 40146 | + type: 'error', | |
| 40147 | + status: 0, | |
| 40148 | + error: isError | |
| 40149 | + ? reason | |
| 40150 | + : new Error(reason ? String(reason) : reason), | |
| 40151 | + aborted: reason && reason.name === 'AbortError' | |
| 40152 | + }) | |
| 40153 | +} | |
| 40154 | + | |
| 40155 | +function makeFilteredResponse (response, state) { | |
| 40156 | + state = { | |
| 40157 | + internalResponse: response, | |
| 40158 | + ...state | |
| 40159 | + } | |
| 40160 | + | |
| 40161 | + return new Proxy(response, { | |
| 40162 | + get (target, p) { | |
| 40163 | + return p in state ? state[p] : target[p] | |
| 40164 | + }, | |
| 40165 | + set (target, p, value) { | |
| 40166 | + assert(!(p in state)) | |
| 40167 | + target[p] = value | |
| 40168 | + return true | |
| 40169 | + } | |
| 40170 | + }) | |
| 40171 | +} | |
| 40172 | + | |
| 40173 | +// https://fetch.spec.whatwg.org/#concept-filtered-response | |
| 40174 | +function filterResponse (response, type) { | |
| 40175 | + // Set response to the following filtered response with response as its | |
| 40176 | + // internal response, depending on request’s response tainting: | |
| 40177 | + if (type === 'basic') { | |
| 40178 | + // A basic filtered response is a filtered response whose type is "basic" | |
| 40179 | + // and header list excludes any headers in internal response’s header list | |
| 40180 | + // whose name is a forbidden response-header name. | |
| 40181 | + | |
| 40182 | + // Note: undici does not implement forbidden response-header names | |
| 40183 | + return makeFilteredResponse(response, { | |
| 40184 | + type: 'basic', | |
| 40185 | + headersList: response.headersList | |
| 40186 | + }) | |
| 40187 | + } else if (type === 'cors') { | |
| 40188 | + // A CORS filtered response is a filtered response whose type is "cors" | |
| 40189 | + // and header list excludes any headers in internal response’s header | |
| 40190 | + // list whose name is not a CORS-safelisted response-header name, given | |
| 40191 | + // internal response’s CORS-exposed header-name list. | |
| 40192 | + | |
| 40193 | + // Note: undici does not implement CORS-safelisted response-header names | |
| 40194 | + return makeFilteredResponse(response, { | |
| 40195 | + type: 'cors', | |
| 40196 | + headersList: response.headersList | |
| 40197 | + }) | |
| 40198 | + } else if (type === 'opaque') { | |
| 40199 | + // An opaque filtered response is a filtered response whose type is | |
| 40200 | + // "opaque", URL list is the empty list, status is 0, status message | |
| 40201 | + // is the empty byte sequence, header list is empty, and body is null. | |
| 40202 | + | |
| 40203 | + return makeFilteredResponse(response, { | |
| 40204 | + type: 'opaque', | |
| 40205 | + urlList: Object.freeze([]), | |
| 40206 | + status: 0, | |
| 40207 | + statusText: '', | |
| 40208 | + body: null | |
| 40209 | + }) | |
| 40210 | + } else if (type === 'opaqueredirect') { | |
| 40211 | + // An opaque-redirect filtered response is a filtered response whose type | |
| 40212 | + // is "opaqueredirect", status is 0, status message is the empty byte | |
| 40213 | + // sequence, header list is empty, and body is null. | |
| 40214 | + | |
| 40215 | + return makeFilteredResponse(response, { | |
| 40216 | + type: 'opaqueredirect', | |
| 40217 | + status: 0, | |
| 40218 | + statusText: '', | |
| 40219 | + headersList: [], | |
| 40220 | + body: null | |
| 40221 | + }) | |
| 40222 | + } else { | |
| 40223 | + assert(false) | |
| 40224 | + } | |
| 40225 | +} | |
| 40226 | + | |
| 40227 | +// https://fetch.spec.whatwg.org/#appropriate-network-error | |
| 40228 | +function makeAppropriateNetworkError (fetchParams, err = null) { | |
| 40229 | + // 1. Assert: fetchParams is canceled. | |
| 40230 | + assert(isCancelled(fetchParams)) | |
| 40231 | + | |
| 40232 | + // 2. Return an aborted network error if fetchParams is aborted; | |
| 40233 | + // otherwise return a network error. | |
| 40234 | + return isAborted(fetchParams) | |
| 40235 | + ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) | |
| 40236 | + : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) | |
| 40237 | +} | |
| 40238 | + | |
| 40239 | +// https://whatpr.org/fetch/1392.html#initialize-a-response | |
| 40240 | +function initializeResponse (response, init, body) { | |
| 40241 | + // 1. If init["status"] is not in the range 200 to 599, inclusive, then | |
| 40242 | + // throw a RangeError. | |
| 40243 | + if (init.status !== null && (init.status < 200 || init.status > 599)) { | |
| 40244 | + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') | |
| 40245 | + } | |
| 40246 | + | |
| 40247 | + // 2. If init["statusText"] does not match the reason-phrase token production, | |
| 40248 | + // then throw a TypeError. | |
| 40249 | + if ('statusText' in init && init.statusText != null) { | |
| 40250 | + // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: | |
| 40251 | + // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) | |
| 40252 | + if (!isValidReasonPhrase(String(init.statusText))) { | |
| 40253 | + throw new TypeError('Invalid statusText') | |
| 40254 | + } | |
| 40255 | + } | |
| 40256 | + | |
| 40257 | + // 3. Set response’s response’s status to init["status"]. | |
| 40258 | + if ('status' in init && init.status != null) { | |
| 40259 | + response[kState].status = init.status | |
| 40260 | + } | |
| 40261 | + | |
| 40262 | + // 4. Set response’s response’s status message to init["statusText"]. | |
| 40263 | + if ('statusText' in init && init.statusText != null) { | |
| 40264 | + response[kState].statusText = init.statusText | |
| 40265 | + } | |
| 40266 | + | |
| 40267 | + // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. | |
| 40268 | + if ('headers' in init && init.headers != null) { | |
| 40269 | + fill(response[kHeaders], init.headers) | |
| 40270 | + } | |
| 40271 | + | |
| 40272 | + // 6. If body was given, then: | |
| 40273 | + if (body) { | |
| 40274 | + // 1. If response's status is a null body status, then throw a TypeError. | |
| 40275 | + if (nullBodyStatus.includes(response.status)) { | |
| 40276 | + throw webidl.errors.exception({ | |
| 40277 | + header: 'Response constructor', | |
| 40278 | + message: 'Invalid response status code ' + response.status | |
| 40279 | + }) | |
| 40280 | + } | |
| 40281 | + | |
| 40282 | + // 2. Set response's body to body's body. | |
| 40283 | + response[kState].body = body.body | |
| 40284 | + | |
| 40285 | + // 3. If body's type is non-null and response's header list does not contain | |
| 40286 | + // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. | |
| 40287 | + if (body.type != null && !response[kState].headersList.contains('Content-Type')) { | |
| 40288 | + response[kState].headersList.append('content-type', body.type) | |
| 40289 | + } | |
| 40290 | + } | |
| 40291 | +} | |
| 40292 | + | |
| 40293 | +webidl.converters.ReadableStream = webidl.interfaceConverter( | |
| 40294 | + ReadableStream | |
| 40295 | +) | |
| 40296 | + | |
| 40297 | +webidl.converters.FormData = webidl.interfaceConverter( | |
| 40298 | + FormData | |
| 40299 | +) | |
| 40300 | + | |
| 40301 | +webidl.converters.URLSearchParams = webidl.interfaceConverter( | |
| 40302 | + URLSearchParams | |
| 40303 | +) | |
| 40304 | + | |
| 40305 | +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit | |
| 40306 | +webidl.converters.XMLHttpRequestBodyInit = function (V) { | |
| 40307 | + if (typeof V === 'string') { | |
| 40308 | + return webidl.converters.USVString(V) | |
| 40309 | + } | |
| 40310 | + | |
| 40311 | + if (isBlobLike(V)) { | |
| 40312 | + return webidl.converters.Blob(V, { strict: false }) | |
| 40313 | + } | |
| 40314 | + | |
| 40315 | + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { | |
| 40316 | + return webidl.converters.BufferSource(V) | |
| 40317 | + } | |
| 40318 | + | |
| 40319 | + if (util.isFormDataLike(V)) { | |
| 40320 | + return webidl.converters.FormData(V, { strict: false }) | |
| 40321 | + } | |
| 40322 | + | |
| 40323 | + if (V instanceof URLSearchParams) { | |
| 40324 | + return webidl.converters.URLSearchParams(V) | |
| 40325 | + } | |
| 40326 | + | |
| 40327 | + return webidl.converters.DOMString(V) | |
| 40328 | +} | |
| 40329 | + | |
| 40330 | +// https://fetch.spec.whatwg.org/#bodyinit | |
| 40331 | +webidl.converters.BodyInit = function (V) { | |
| 40332 | + if (V instanceof ReadableStream) { | |
| 40333 | + return webidl.converters.ReadableStream(V) | |
| 40334 | + } | |
| 40335 | + | |
| 40336 | + // Note: the spec doesn't include async iterables, | |
| 40337 | + // this is an undici extension. | |
| 40338 | + if (V?.[Symbol.asyncIterator]) { | |
| 40339 | + return V | |
| 40340 | + } | |
| 40341 | + | |
| 40342 | + return webidl.converters.XMLHttpRequestBodyInit(V) | |
| 40343 | +} | |
| 40344 | + | |
| 40345 | +webidl.converters.ResponseInit = webidl.dictionaryConverter([ | |
| 40346 | + { | |
| 40347 | + key: 'status', | |
| 40348 | + converter: webidl.converters['unsigned short'], | |
| 40349 | + defaultValue: 200 | |
| 40350 | + }, | |
| 40351 | + { | |
| 40352 | + key: 'statusText', | |
| 40353 | + converter: webidl.converters.ByteString, | |
| 40354 | + defaultValue: '' | |
| 40355 | + }, | |
| 40356 | + { | |
| 40357 | + key: 'headers', | |
| 40358 | + converter: webidl.converters.HeadersInit | |
| 40359 | + } | |
| 40360 | +]) | |
| 40361 | + | |
| 40362 | +module.exports = { | |
| 40363 | + makeNetworkError, | |
| 40364 | + makeResponse, | |
| 40365 | + makeAppropriateNetworkError, | |
| 40366 | + filterResponse, | |
| 40367 | + Response, | |
| 40368 | + cloneResponse | |
| 40369 | +} | |
| 40370 | + | |
| 40371 | + | |
| 40372 | +/***/ }), | |
| 40373 | + | |
| 40374 | +/***/ 9710: | |
| 40375 | +/***/ ((module) => { | |
| 40376 | + | |
| 40377 | +"use strict"; | |
| 40378 | + | |
| 40379 | + | |
| 40380 | +module.exports = { | |
| 40381 | + kUrl: Symbol('url'), | |
| 40382 | + kHeaders: Symbol('headers'), | |
| 40383 | + kSignal: Symbol('signal'), | |
| 40384 | + kState: Symbol('state'), | |
| 40385 | + kGuard: Symbol('guard'), | |
| 40386 | + kRealm: Symbol('realm') | |
| 40387 | +} | |
| 40388 | + | |
| 40389 | + | |
| 40390 | +/***/ }), | |
| 40391 | + | |
| 40392 | +/***/ 5523: | |
| 40393 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 40394 | + | |
| 40395 | +"use strict"; | |
| 40396 | + | |
| 40397 | + | |
| 40398 | +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(7326) | |
| 40399 | +const { getGlobalOrigin } = __nccwpck_require__(5628) | |
| 40400 | +const { performance } = __nccwpck_require__(2987) | |
| 40401 | +const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3440) | |
| 40402 | +const assert = __nccwpck_require__(2613) | |
| 40403 | +const { isUint8Array } = __nccwpck_require__(8253) | |
| 40404 | + | |
| 40405 | +let supportedHashes = [] | |
| 40406 | + | |
| 40407 | +// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable | |
| 40408 | +/** @type {import('crypto')|undefined} */ | |
| 40409 | +let crypto | |
| 40410 | + | |
| 40411 | +try { | |
| 40412 | + crypto = __nccwpck_require__(6982) | |
| 40413 | + const possibleRelevantHashes = ['sha256', 'sha384', 'sha512'] | |
| 40414 | + supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)) | |
| 40415 | +/* c8 ignore next 3 */ | |
| 40416 | +} catch { | |
| 40417 | +} | |
| 40418 | + | |
| 40419 | +function responseURL (response) { | |
| 40420 | + // https://fetch.spec.whatwg.org/#responses | |
| 40421 | + // A response has an associated URL. It is a pointer to the last URL | |
| 40422 | + // in response’s URL list and null if response’s URL list is empty. | |
| 40423 | + const urlList = response.urlList | |
| 40424 | + const length = urlList.length | |
| 40425 | + return length === 0 ? null : urlList[length - 1].toString() | |
| 40426 | +} | |
| 40427 | + | |
| 40428 | +// https://fetch.spec.whatwg.org/#concept-response-location-url | |
| 40429 | +function responseLocationURL (response, requestFragment) { | |
| 40430 | + // 1. If response’s status is not a redirect status, then return null. | |
| 40431 | + if (!redirectStatusSet.has(response.status)) { | |
| 40432 | + return null | |
| 40433 | + } | |
| 40434 | + | |
| 40435 | + // 2. Let location be the result of extracting header list values given | |
| 40436 | + // `Location` and response’s header list. | |
| 40437 | + let location = response.headersList.get('location') | |
| 40438 | + | |
| 40439 | + // 3. If location is a header value, then set location to the result of | |
| 40440 | + // parsing location with response’s URL. | |
| 40441 | + if (location !== null && isValidHeaderValue(location)) { | |
| 40442 | + location = new URL(location, responseURL(response)) | |
| 40443 | + } | |
| 40444 | + | |
| 40445 | + // 4. If location is a URL whose fragment is null, then set location’s | |
| 40446 | + // fragment to requestFragment. | |
| 40447 | + if (location && !location.hash) { | |
| 40448 | + location.hash = requestFragment | |
| 40449 | + } | |
| 40450 | + | |
| 40451 | + // 5. Return location. | |
| 40452 | + return location | |
| 40453 | +} | |
| 40454 | + | |
| 40455 | +/** @returns {URL} */ | |
| 40456 | +function requestCurrentURL (request) { | |
| 40457 | + return request.urlList[request.urlList.length - 1] | |
| 40458 | +} | |
| 40459 | + | |
| 40460 | +function requestBadPort (request) { | |
| 40461 | + // 1. Let url be request’s current URL. | |
| 40462 | + const url = requestCurrentURL(request) | |
| 40463 | + | |
| 40464 | + // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, | |
| 40465 | + // then return blocked. | |
| 40466 | + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { | |
| 40467 | + return 'blocked' | |
| 40468 | + } | |
| 40469 | + | |
| 40470 | + // 3. Return allowed. | |
| 40471 | + return 'allowed' | |
| 40472 | +} | |
| 40473 | + | |
| 40474 | +function isErrorLike (object) { | |
| 40475 | + return object instanceof Error || ( | |
| 40476 | + object?.constructor?.name === 'Error' || | |
| 40477 | + object?.constructor?.name === 'DOMException' | |
| 40478 | + ) | |
| 40479 | +} | |
| 40480 | + | |
| 40481 | +// Check whether |statusText| is a ByteString and | |
| 40482 | +// matches the Reason-Phrase token production. | |
| 40483 | +// RFC 2616: https://tools.ietf.org/html/rfc2616 | |
| 40484 | +// RFC 7230: https://tools.ietf.org/html/rfc7230 | |
| 40485 | +// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" | |
| 40486 | +// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 | |
| 40487 | +function isValidReasonPhrase (statusText) { | |
| 40488 | + for (let i = 0; i < statusText.length; ++i) { | |
| 40489 | + const c = statusText.charCodeAt(i) | |
| 40490 | + if ( | |
| 40491 | + !( | |
| 40492 | + ( | |
| 40493 | + c === 0x09 || // HTAB | |
| 40494 | + (c >= 0x20 && c <= 0x7e) || // SP / VCHAR | |
| 40495 | + (c >= 0x80 && c <= 0xff) | |
| 40496 | + ) // obs-text | |
| 40497 | + ) | |
| 40498 | + ) { | |
| 40499 | + return false | |
| 40500 | + } | |
| 40501 | + } | |
| 40502 | + return true | |
| 40503 | +} | |
| 40504 | + | |
| 40505 | +/** | |
| 40506 | + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 | |
| 40507 | + * @param {number} c | |
| 40508 | + */ | |
| 40509 | +function isTokenCharCode (c) { | |
| 40510 | + switch (c) { | |
| 40511 | + case 0x22: | |
| 40512 | + case 0x28: | |
| 40513 | + case 0x29: | |
| 40514 | + case 0x2c: | |
| 40515 | + case 0x2f: | |
| 40516 | + case 0x3a: | |
| 40517 | + case 0x3b: | |
| 40518 | + case 0x3c: | |
| 40519 | + case 0x3d: | |
| 40520 | + case 0x3e: | |
| 40521 | + case 0x3f: | |
| 40522 | + case 0x40: | |
| 40523 | + case 0x5b: | |
| 40524 | + case 0x5c: | |
| 40525 | + case 0x5d: | |
| 40526 | + case 0x7b: | |
| 40527 | + case 0x7d: | |
| 40528 | + // DQUOTE and "(),/:;<=>?@[\]{}" | |
| 40529 | + return false | |
| 40530 | + default: | |
| 40531 | + // VCHAR %x21-7E | |
| 40532 | + return c >= 0x21 && c <= 0x7e | |
| 40533 | + } | |
| 40534 | +} | |
| 40535 | + | |
| 40536 | +/** | |
| 40537 | + * @param {string} characters | |
| 40538 | + */ | |
| 40539 | +function isValidHTTPToken (characters) { | |
| 40540 | + if (characters.length === 0) { | |
| 40541 | + return false | |
| 40542 | + } | |
| 40543 | + for (let i = 0; i < characters.length; ++i) { | |
| 40544 | + if (!isTokenCharCode(characters.charCodeAt(i))) { | |
| 40545 | + return false | |
| 40546 | + } | |
| 40547 | + } | |
| 40548 | + return true | |
| 40549 | +} | |
| 40550 | + | |
| 40551 | +/** | |
| 40552 | + * @see https://fetch.spec.whatwg.org/#header-name | |
| 40553 | + * @param {string} potentialValue | |
| 40554 | + */ | |
| 40555 | +function isValidHeaderName (potentialValue) { | |
| 40556 | + return isValidHTTPToken(potentialValue) | |
| 40557 | +} | |
| 40558 | + | |
| 40559 | +/** | |
| 40560 | + * @see https://fetch.spec.whatwg.org/#header-value | |
| 40561 | + * @param {string} potentialValue | |
| 40562 | + */ | |
| 40563 | +function isValidHeaderValue (potentialValue) { | |
| 40564 | + // - Has no leading or trailing HTTP tab or space bytes. | |
| 40565 | + // - Contains no 0x00 (NUL) or HTTP newline bytes. | |
| 40566 | + if ( | |
| 40567 | + potentialValue.startsWith('\t') || | |
| 40568 | + potentialValue.startsWith(' ') || | |
| 40569 | + potentialValue.endsWith('\t') || | |
| 40570 | + potentialValue.endsWith(' ') | |
| 40571 | + ) { | |
| 40572 | + return false | |
| 40573 | + } | |
| 40574 | + | |
| 40575 | + if ( | |
| 40576 | + potentialValue.includes('\0') || | |
| 40577 | + potentialValue.includes('\r') || | |
| 40578 | + potentialValue.includes('\n') | |
| 40579 | + ) { | |
| 40580 | + return false | |
| 40581 | + } | |
| 40582 | + | |
| 40583 | + return true | |
| 40584 | +} | |
| 40585 | + | |
| 40586 | +// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect | |
| 40587 | +function setRequestReferrerPolicyOnRedirect (request, actualResponse) { | |
| 40588 | + // Given a request request and a response actualResponse, this algorithm | |
| 40589 | + // updates request’s referrer policy according to the Referrer-Policy | |
| 40590 | + // header (if any) in actualResponse. | |
| 40591 | + | |
| 40592 | + // 1. Let policy be the result of executing § 8.1 Parse a referrer policy | |
| 40593 | + // from a Referrer-Policy header on actualResponse. | |
| 40594 | + | |
| 40595 | + // 8.1 Parse a referrer policy from a Referrer-Policy header | |
| 40596 | + // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. | |
| 40597 | + const { headersList } = actualResponse | |
| 40598 | + // 2. Let policy be the empty string. | |
| 40599 | + // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. | |
| 40600 | + // 4. Return policy. | |
| 40601 | + const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') | |
| 40602 | + | |
| 40603 | + // Note: As the referrer-policy can contain multiple policies | |
| 40604 | + // separated by comma, we need to loop through all of them | |
| 40605 | + // and pick the first valid one. | |
| 40606 | + // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy | |
| 40607 | + let policy = '' | |
| 40608 | + if (policyHeader.length > 0) { | |
| 40609 | + // The right-most policy takes precedence. | |
| 40610 | + // The left-most policy is the fallback. | |
| 40611 | + for (let i = policyHeader.length; i !== 0; i--) { | |
| 40612 | + const token = policyHeader[i - 1].trim() | |
| 40613 | + if (referrerPolicyTokens.has(token)) { | |
| 40614 | + policy = token | |
| 40615 | + break | |
| 40616 | + } | |
| 40617 | + } | |
| 40618 | + } | |
| 40619 | + | |
| 40620 | + // 2. If policy is not the empty string, then set request’s referrer policy to policy. | |
| 40621 | + if (policy !== '') { | |
| 40622 | + request.referrerPolicy = policy | |
| 40623 | + } | |
| 40624 | +} | |
| 40625 | + | |
| 40626 | +// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check | |
| 40627 | +function crossOriginResourcePolicyCheck () { | |
| 40628 | + // TODO | |
| 40629 | + return 'allowed' | |
| 40630 | +} | |
| 40631 | + | |
| 40632 | +// https://fetch.spec.whatwg.org/#concept-cors-check | |
| 40633 | +function corsCheck () { | |
| 40634 | + // TODO | |
| 40635 | + return 'success' | |
| 40636 | +} | |
| 40637 | + | |
| 40638 | +// https://fetch.spec.whatwg.org/#concept-tao-check | |
| 40639 | +function TAOCheck () { | |
| 40640 | + // TODO | |
| 40641 | + return 'success' | |
| 40642 | +} | |
| 40643 | + | |
| 40644 | +function appendFetchMetadata (httpRequest) { | |
| 40645 | + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header | |
| 40646 | + // TODO | |
| 40647 | + | |
| 40648 | + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header | |
| 40649 | + | |
| 40650 | + // 1. Assert: r’s url is a potentially trustworthy URL. | |
| 40651 | + // TODO | |
| 40652 | + | |
| 40653 | + // 2. Let header be a Structured Header whose value is a token. | |
| 40654 | + let header = null | |
| 40655 | + | |
| 40656 | + // 3. Set header’s value to r’s mode. | |
| 40657 | + header = httpRequest.mode | |
| 40658 | + | |
| 40659 | + // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. | |
| 40660 | + httpRequest.headersList.set('sec-fetch-mode', header) | |
| 40661 | + | |
| 40662 | + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header | |
| 40663 | + // TODO | |
| 40664 | + | |
| 40665 | + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header | |
| 40666 | + // TODO | |
| 40667 | +} | |
| 40668 | + | |
| 40669 | +// https://fetch.spec.whatwg.org/#append-a-request-origin-header | |
| 40670 | +function appendRequestOriginHeader (request) { | |
| 40671 | + // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. | |
| 40672 | + let serializedOrigin = request.origin | |
| 40673 | + | |
| 40674 | + // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. | |
| 40675 | + if (request.responseTainting === 'cors' || request.mode === 'websocket') { | |
| 40676 | + if (serializedOrigin) { | |
| 40677 | + request.headersList.append('origin', serializedOrigin) | |
| 40678 | + } | |
| 40679 | + | |
| 40680 | + // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: | |
| 40681 | + } else if (request.method !== 'GET' && request.method !== 'HEAD') { | |
| 40682 | + // 1. Switch on request’s referrer policy: | |
| 40683 | + switch (request.referrerPolicy) { | |
| 40684 | + case 'no-referrer': | |
| 40685 | + // Set serializedOrigin to `null`. | |
| 40686 | + serializedOrigin = null | |
| 40687 | + break | |
| 40688 | + case 'no-referrer-when-downgrade': | |
| 40689 | + case 'strict-origin': | |
| 40690 | + case 'strict-origin-when-cross-origin': | |
| 40691 | + // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. | |
| 40692 | + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { | |
| 40693 | + serializedOrigin = null | |
| 40694 | + } | |
| 40695 | + break | |
| 40696 | + case 'same-origin': | |
| 40697 | + // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. | |
| 40698 | + if (!sameOrigin(request, requestCurrentURL(request))) { | |
| 40699 | + serializedOrigin = null | |
| 40700 | + } | |
| 40701 | + break | |
| 40702 | + default: | |
| 40703 | + // Do nothing. | |
| 40704 | + } | |
| 40705 | + | |
| 40706 | + if (serializedOrigin) { | |
| 40707 | + // 2. Append (`Origin`, serializedOrigin) to request’s header list. | |
| 40708 | + request.headersList.append('origin', serializedOrigin) | |
| 40709 | + } | |
| 40710 | + } | |
| 40711 | +} | |
| 40712 | + | |
| 40713 | +function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { | |
| 40714 | + // TODO | |
| 40715 | + return performance.now() | |
| 40716 | +} | |
| 40717 | + | |
| 40718 | +// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info | |
| 40719 | +function createOpaqueTimingInfo (timingInfo) { | |
| 40720 | + return { | |
| 40721 | + startTime: timingInfo.startTime ?? 0, | |
| 40722 | + redirectStartTime: 0, | |
| 40723 | + redirectEndTime: 0, | |
| 40724 | + postRedirectStartTime: timingInfo.startTime ?? 0, | |
| 40725 | + finalServiceWorkerStartTime: 0, | |
| 40726 | + finalNetworkResponseStartTime: 0, | |
| 40727 | + finalNetworkRequestStartTime: 0, | |
| 40728 | + endTime: 0, | |
| 40729 | + encodedBodySize: 0, | |
| 40730 | + decodedBodySize: 0, | |
| 40731 | + finalConnectionTimingInfo: null | |
| 40732 | + } | |
| 40733 | +} | |
| 40734 | + | |
| 40735 | +// https://html.spec.whatwg.org/multipage/origin.html#policy-container | |
| 40736 | +function makePolicyContainer () { | |
| 40737 | + // Note: the fetch spec doesn't make use of embedder policy or CSP list | |
| 40738 | + return { | |
| 40739 | + referrerPolicy: 'strict-origin-when-cross-origin' | |
| 40740 | + } | |
| 40741 | +} | |
| 40742 | + | |
| 40743 | +// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container | |
| 40744 | +function clonePolicyContainer (policyContainer) { | |
| 40745 | + return { | |
| 40746 | + referrerPolicy: policyContainer.referrerPolicy | |
| 40747 | + } | |
| 40748 | +} | |
| 40749 | + | |
| 40750 | +// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer | |
| 40751 | +function determineRequestsReferrer (request) { | |
| 40752 | + // 1. Let policy be request's referrer policy. | |
| 40753 | + const policy = request.referrerPolicy | |
| 40754 | + | |
| 40755 | + // Note: policy cannot (shouldn't) be null or an empty string. | |
| 40756 | + assert(policy) | |
| 40757 | + | |
| 40758 | + // 2. Let environment be request’s client. | |
| 40759 | + | |
| 40760 | + let referrerSource = null | |
| 40761 | + | |
| 40762 | + // 3. Switch on request’s referrer: | |
| 40763 | + if (request.referrer === 'client') { | |
| 40764 | + // Note: node isn't a browser and doesn't implement document/iframes, | |
| 40765 | + // so we bypass this step and replace it with our own. | |
| 40766 | + | |
| 40767 | + const globalOrigin = getGlobalOrigin() | |
| 40768 | + | |
| 40769 | + if (!globalOrigin || globalOrigin.origin === 'null') { | |
| 40770 | + return 'no-referrer' | |
| 40771 | + } | |
| 40772 | + | |
| 40773 | + // note: we need to clone it as it's mutated | |
| 40774 | + referrerSource = new URL(globalOrigin) | |
| 40775 | + } else if (request.referrer instanceof URL) { | |
| 40776 | + // Let referrerSource be request’s referrer. | |
| 40777 | + referrerSource = request.referrer | |
| 40778 | + } | |
| 40779 | + | |
| 40780 | + // 4. Let request’s referrerURL be the result of stripping referrerSource for | |
| 40781 | + // use as a referrer. | |
| 40782 | + let referrerURL = stripURLForReferrer(referrerSource) | |
| 40783 | + | |
| 40784 | + // 5. Let referrerOrigin be the result of stripping referrerSource for use as | |
| 40785 | + // a referrer, with the origin-only flag set to true. | |
| 40786 | + const referrerOrigin = stripURLForReferrer(referrerSource, true) | |
| 40787 | + | |
| 40788 | + // 6. If the result of serializing referrerURL is a string whose length is | |
| 40789 | + // greater than 4096, set referrerURL to referrerOrigin. | |
| 40790 | + if (referrerURL.toString().length > 4096) { | |
| 40791 | + referrerURL = referrerOrigin | |
| 40792 | + } | |
| 40793 | + | |
| 40794 | + const areSameOrigin = sameOrigin(request, referrerURL) | |
| 40795 | + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && | |
| 40796 | + !isURLPotentiallyTrustworthy(request.url) | |
| 40797 | + | |
| 40798 | + // 8. Execute the switch statements corresponding to the value of policy: | |
| 40799 | + switch (policy) { | |
| 40800 | + case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) | |
| 40801 | + case 'unsafe-url': return referrerURL | |
| 40802 | + case 'same-origin': | |
| 40803 | + return areSameOrigin ? referrerOrigin : 'no-referrer' | |
| 40804 | + case 'origin-when-cross-origin': | |
| 40805 | + return areSameOrigin ? referrerURL : referrerOrigin | |
| 40806 | + case 'strict-origin-when-cross-origin': { | |
| 40807 | + const currentURL = requestCurrentURL(request) | |
| 40808 | + | |
| 40809 | + // 1. If the origin of referrerURL and the origin of request’s current | |
| 40810 | + // URL are the same, then return referrerURL. | |
| 40811 | + if (sameOrigin(referrerURL, currentURL)) { | |
| 40812 | + return referrerURL | |
| 40813 | + } | |
| 40814 | + | |
| 40815 | + // 2. If referrerURL is a potentially trustworthy URL and request’s | |
| 40816 | + // current URL is not a potentially trustworthy URL, then return no | |
| 40817 | + // referrer. | |
| 40818 | + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { | |
| 40819 | + return 'no-referrer' | |
| 40820 | + } | |
| 40821 | + | |
| 40822 | + // 3. Return referrerOrigin. | |
| 40823 | + return referrerOrigin | |
| 40824 | + } | |
| 40825 | + case 'strict-origin': // eslint-disable-line | |
| 40826 | + /** | |
| 40827 | + * 1. If referrerURL is a potentially trustworthy URL and | |
| 40828 | + * request’s current URL is not a potentially trustworthy URL, | |
| 40829 | + * then return no referrer. | |
| 40830 | + * 2. Return referrerOrigin | |
| 40831 | + */ | |
| 40832 | + case 'no-referrer-when-downgrade': // eslint-disable-line | |
| 40833 | + /** | |
| 40834 | + * 1. If referrerURL is a potentially trustworthy URL and | |
| 40835 | + * request’s current URL is not a potentially trustworthy URL, | |
| 40836 | + * then return no referrer. | |
| 40837 | + * 2. Return referrerOrigin | |
| 40838 | + */ | |
| 40839 | + | |
| 40840 | + default: // eslint-disable-line | |
| 40841 | + return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin | |
| 40842 | + } | |
| 40843 | +} | |
| 40844 | + | |
| 40845 | +/** | |
| 40846 | + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url | |
| 40847 | + * @param {URL} url | |
| 40848 | + * @param {boolean|undefined} originOnly | |
| 40849 | + */ | |
| 40850 | +function stripURLForReferrer (url, originOnly) { | |
| 40851 | + // 1. Assert: url is a URL. | |
| 40852 | + assert(url instanceof URL) | |
| 40853 | + | |
| 40854 | + // 2. If url’s scheme is a local scheme, then return no referrer. | |
| 40855 | + if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { | |
| 40856 | + return 'no-referrer' | |
| 40857 | + } | |
| 40858 | + | |
| 40859 | + // 3. Set url’s username to the empty string. | |
| 40860 | + url.username = '' | |
| 40861 | + | |
| 40862 | + // 4. Set url’s password to the empty string. | |
| 40863 | + url.password = '' | |
| 40864 | + | |
| 40865 | + // 5. Set url’s fragment to null. | |
| 40866 | + url.hash = '' | |
| 40867 | + | |
| 40868 | + // 6. If the origin-only flag is true, then: | |
| 40869 | + if (originOnly) { | |
| 40870 | + // 1. Set url’s path to « the empty string ». | |
| 40871 | + url.pathname = '' | |
| 40872 | + | |
| 40873 | + // 2. Set url’s query to null. | |
| 40874 | + url.search = '' | |
| 40875 | + } | |
| 40876 | + | |
| 40877 | + // 7. Return url. | |
| 40878 | + return url | |
| 40879 | +} | |
| 40880 | + | |
| 40881 | +function isURLPotentiallyTrustworthy (url) { | |
| 40882 | + if (!(url instanceof URL)) { | |
| 40883 | + return false | |
| 40884 | + } | |
| 40885 | + | |
| 40886 | + // If child of about, return true | |
| 40887 | + if (url.href === 'about:blank' || url.href === 'about:srcdoc') { | |
| 40888 | + return true | |
| 40889 | + } | |
| 40890 | + | |
| 40891 | + // If scheme is data, return true | |
| 40892 | + if (url.protocol === 'data:') return true | |
| 40893 | + | |
| 40894 | + // If file, return true | |
| 40895 | + if (url.protocol === 'file:') return true | |
| 40896 | + | |
| 40897 | + return isOriginPotentiallyTrustworthy(url.origin) | |
| 40898 | + | |
| 40899 | + function isOriginPotentiallyTrustworthy (origin) { | |
| 40900 | + // If origin is explicitly null, return false | |
| 40901 | + if (origin == null || origin === 'null') return false | |
| 40902 | + | |
| 40903 | + const originAsURL = new URL(origin) | |
| 40904 | + | |
| 40905 | + // If secure, return true | |
| 40906 | + if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { | |
| 40907 | + return true | |
| 40908 | + } | |
| 40909 | + | |
| 40910 | + // If localhost or variants, return true | |
| 40911 | + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || | |
| 40912 | + (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || | |
| 40913 | + (originAsURL.hostname.endsWith('.localhost'))) { | |
| 40914 | + return true | |
| 40915 | + } | |
| 40916 | + | |
| 40917 | + // If any other, return false | |
| 40918 | + return false | |
| 40919 | + } | |
| 40920 | +} | |
| 40921 | + | |
| 40922 | +/** | |
| 40923 | + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist | |
| 40924 | + * @param {Uint8Array} bytes | |
| 40925 | + * @param {string} metadataList | |
| 40926 | + */ | |
| 40927 | +function bytesMatch (bytes, metadataList) { | |
| 40928 | + // If node is not built with OpenSSL support, we cannot check | |
| 40929 | + // a request's integrity, so allow it by default (the spec will | |
| 40930 | + // allow requests if an invalid hash is given, as precedence). | |
| 40931 | + /* istanbul ignore if: only if node is built with --without-ssl */ | |
| 40932 | + if (crypto === undefined) { | |
| 40933 | + return true | |
| 40934 | + } | |
| 40935 | + | |
| 40936 | + // 1. Let parsedMetadata be the result of parsing metadataList. | |
| 40937 | + const parsedMetadata = parseMetadata(metadataList) | |
| 40938 | + | |
| 40939 | + // 2. If parsedMetadata is no metadata, return true. | |
| 40940 | + if (parsedMetadata === 'no metadata') { | |
| 40941 | + return true | |
| 40942 | + } | |
| 40943 | + | |
| 40944 | + // 3. If response is not eligible for integrity validation, return false. | |
| 40945 | + // TODO | |
| 40946 | + | |
| 40947 | + // 4. If parsedMetadata is the empty set, return true. | |
| 40948 | + if (parsedMetadata.length === 0) { | |
| 40949 | + return true | |
| 40950 | + } | |
| 40951 | + | |
| 40952 | + // 5. Let metadata be the result of getting the strongest | |
| 40953 | + // metadata from parsedMetadata. | |
| 40954 | + const strongest = getStrongestMetadata(parsedMetadata) | |
| 40955 | + const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest) | |
| 40956 | + | |
| 40957 | + // 6. For each item in metadata: | |
| 40958 | + for (const item of metadata) { | |
| 40959 | + // 1. Let algorithm be the alg component of item. | |
| 40960 | + const algorithm = item.algo | |
| 40961 | + | |
| 40962 | + // 2. Let expectedValue be the val component of item. | |
| 40963 | + const expectedValue = item.hash | |
| 40964 | + | |
| 40965 | + // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e | |
| 40966 | + // "be liberal with padding". This is annoying, and it's not even in the spec. | |
| 40967 | + | |
| 40968 | + // 3. Let actualValue be the result of applying algorithm to bytes. | |
| 40969 | + let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') | |
| 40970 | + | |
| 40971 | + if (actualValue[actualValue.length - 1] === '=') { | |
| 40972 | + if (actualValue[actualValue.length - 2] === '=') { | |
| 40973 | + actualValue = actualValue.slice(0, -2) | |
| 40974 | + } else { | |
| 40975 | + actualValue = actualValue.slice(0, -1) | |
| 40976 | + } | |
| 40977 | + } | |
| 40978 | + | |
| 40979 | + // 4. If actualValue is a case-sensitive match for expectedValue, | |
| 40980 | + // return true. | |
| 40981 | + if (compareBase64Mixed(actualValue, expectedValue)) { | |
| 40982 | + return true | |
| 40983 | + } | |
| 40984 | + } | |
| 40985 | + | |
| 40986 | + // 7. Return false. | |
| 40987 | + return false | |
| 40988 | +} | |
| 40989 | + | |
| 40990 | +// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options | |
| 40991 | +// https://www.w3.org/TR/CSP2/#source-list-syntax | |
| 40992 | +// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 | |
| 40993 | +const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i | |
| 40994 | + | |
| 40995 | +/** | |
| 40996 | + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata | |
| 40997 | + * @param {string} metadata | |
| 40998 | + */ | |
| 40999 | +function parseMetadata (metadata) { | |
| 41000 | + // 1. Let result be the empty set. | |
| 41001 | + /** @type {{ algo: string, hash: string }[]} */ | |
| 41002 | + const result = [] | |
| 41003 | + | |
| 41004 | + // 2. Let empty be equal to true. | |
| 41005 | + let empty = true | |
| 41006 | + | |
| 41007 | + // 3. For each token returned by splitting metadata on spaces: | |
| 41008 | + for (const token of metadata.split(' ')) { | |
| 41009 | + // 1. Set empty to false. | |
| 41010 | + empty = false | |
| 41011 | + | |
| 41012 | + // 2. Parse token as a hash-with-options. | |
| 41013 | + const parsedToken = parseHashWithOptions.exec(token) | |
| 41014 | + | |
| 41015 | + // 3. If token does not parse, continue to the next token. | |
| 41016 | + if ( | |
| 41017 | + parsedToken === null || | |
| 41018 | + parsedToken.groups === undefined || | |
| 41019 | + parsedToken.groups.algo === undefined | |
| 41020 | + ) { | |
| 41021 | + // Note: Chromium blocks the request at this point, but Firefox | |
| 41022 | + // gives a warning that an invalid integrity was given. The | |
| 41023 | + // correct behavior is to ignore these, and subsequently not | |
| 41024 | + // check the integrity of the resource. | |
| 41025 | + continue | |
| 41026 | + } | |
| 41027 | + | |
| 41028 | + // 4. Let algorithm be the hash-algo component of token. | |
| 41029 | + const algorithm = parsedToken.groups.algo.toLowerCase() | |
| 41030 | + | |
| 41031 | + // 5. If algorithm is a hash function recognized by the user | |
| 41032 | + // agent, add the parsed token to result. | |
| 41033 | + if (supportedHashes.includes(algorithm)) { | |
| 41034 | + result.push(parsedToken.groups) | |
| 41035 | + } | |
| 41036 | + } | |
| 41037 | + | |
| 41038 | + // 4. Return no metadata if empty is true, otherwise return result. | |
| 41039 | + if (empty === true) { | |
| 41040 | + return 'no metadata' | |
| 41041 | + } | |
| 41042 | + | |
| 41043 | + return result | |
| 41044 | +} | |
| 41045 | + | |
| 41046 | +/** | |
| 41047 | + * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList | |
| 41048 | + */ | |
| 41049 | +function getStrongestMetadata (metadataList) { | |
| 41050 | + // Let algorithm be the algo component of the first item in metadataList. | |
| 41051 | + // Can be sha256 | |
| 41052 | + let algorithm = metadataList[0].algo | |
| 41053 | + // If the algorithm is sha512, then it is the strongest | |
| 41054 | + // and we can return immediately | |
| 41055 | + if (algorithm[3] === '5') { | |
| 41056 | + return algorithm | |
| 41057 | + } | |
| 41058 | + | |
| 41059 | + for (let i = 1; i < metadataList.length; ++i) { | |
| 41060 | + const metadata = metadataList[i] | |
| 41061 | + // If the algorithm is sha512, then it is the strongest | |
| 41062 | + // and we can break the loop immediately | |
| 41063 | + if (metadata.algo[3] === '5') { | |
| 41064 | + algorithm = 'sha512' | |
| 41065 | + break | |
| 41066 | + // If the algorithm is sha384, then a potential sha256 or sha384 is ignored | |
| 41067 | + } else if (algorithm[3] === '3') { | |
| 41068 | + continue | |
| 41069 | + // algorithm is sha256, check if algorithm is sha384 and if so, set it as | |
| 41070 | + // the strongest | |
| 41071 | + } else if (metadata.algo[3] === '3') { | |
| 41072 | + algorithm = 'sha384' | |
| 41073 | + } | |
| 41074 | + } | |
| 41075 | + return algorithm | |
| 41076 | +} | |
| 41077 | + | |
| 41078 | +function filterMetadataListByAlgorithm (metadataList, algorithm) { | |
| 41079 | + if (metadataList.length === 1) { | |
| 41080 | + return metadataList | |
| 41081 | + } | |
| 41082 | + | |
| 41083 | + let pos = 0 | |
| 41084 | + for (let i = 0; i < metadataList.length; ++i) { | |
| 41085 | + if (metadataList[i].algo === algorithm) { | |
| 41086 | + metadataList[pos++] = metadataList[i] | |
| 41087 | + } | |
| 41088 | + } | |
| 41089 | + | |
| 41090 | + metadataList.length = pos | |
| 41091 | + | |
| 41092 | + return metadataList | |
| 41093 | +} | |
| 41094 | + | |
| 41095 | +/** | |
| 41096 | + * Compares two base64 strings, allowing for base64url | |
| 41097 | + * in the second string. | |
| 41098 | + * | |
| 41099 | +* @param {string} actualValue always base64 | |
| 41100 | + * @param {string} expectedValue base64 or base64url | |
| 41101 | + * @returns {boolean} | |
| 41102 | + */ | |
| 41103 | +function compareBase64Mixed (actualValue, expectedValue) { | |
| 41104 | + if (actualValue.length !== expectedValue.length) { | |
| 41105 | + return false | |
| 41106 | + } | |
| 41107 | + for (let i = 0; i < actualValue.length; ++i) { | |
| 41108 | + if (actualValue[i] !== expectedValue[i]) { | |
| 41109 | + if ( | |
| 41110 | + (actualValue[i] === '+' && expectedValue[i] === '-') || | |
| 41111 | + (actualValue[i] === '/' && expectedValue[i] === '_') | |
| 41112 | + ) { | |
| 41113 | + continue | |
| 41114 | + } | |
| 41115 | + return false | |
| 41116 | + } | |
| 41117 | + } | |
| 41118 | + | |
| 41119 | + return true | |
| 41120 | +} | |
| 41121 | + | |
| 41122 | +// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request | |
| 41123 | +function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { | |
| 41124 | + // TODO | |
| 41125 | +} | |
| 41126 | + | |
| 41127 | +/** | |
| 41128 | + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} | |
| 41129 | + * @param {URL} A | |
| 41130 | + * @param {URL} B | |
| 41131 | + */ | |
| 41132 | +function sameOrigin (A, B) { | |
| 41133 | + // 1. If A and B are the same opaque origin, then return true. | |
| 41134 | + if (A.origin === B.origin && A.origin === 'null') { | |
| 41135 | + return true | |
| 41136 | + } | |
| 41137 | + | |
| 41138 | + // 2. If A and B are both tuple origins and their schemes, | |
| 41139 | + // hosts, and port are identical, then return true. | |
| 41140 | + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { | |
| 41141 | + return true | |
| 41142 | + } | |
| 41143 | + | |
| 41144 | + // 3. Return false. | |
| 41145 | + return false | |
| 41146 | +} | |
| 41147 | + | |
| 41148 | +function createDeferredPromise () { | |
| 41149 | + let res | |
| 41150 | + let rej | |
| 41151 | + const promise = new Promise((resolve, reject) => { | |
| 41152 | + res = resolve | |
| 41153 | + rej = reject | |
| 41154 | + }) | |
| 41155 | + | |
| 41156 | + return { promise, resolve: res, reject: rej } | |
| 41157 | +} | |
| 41158 | + | |
| 41159 | +function isAborted (fetchParams) { | |
| 41160 | + return fetchParams.controller.state === 'aborted' | |
| 41161 | +} | |
| 41162 | + | |
| 41163 | +function isCancelled (fetchParams) { | |
| 41164 | + return fetchParams.controller.state === 'aborted' || | |
| 41165 | + fetchParams.controller.state === 'terminated' | |
| 41166 | +} | |
| 41167 | + | |
| 41168 | +const normalizeMethodRecord = { | |
| 41169 | + delete: 'DELETE', | |
| 41170 | + DELETE: 'DELETE', | |
| 41171 | + get: 'GET', | |
| 41172 | + GET: 'GET', | |
| 41173 | + head: 'HEAD', | |
| 41174 | + HEAD: 'HEAD', | |
| 41175 | + options: 'OPTIONS', | |
| 41176 | + OPTIONS: 'OPTIONS', | |
| 41177 | + post: 'POST', | |
| 41178 | + POST: 'POST', | |
| 41179 | + put: 'PUT', | |
| 41180 | + PUT: 'PUT' | |
| 41181 | +} | |
| 41182 | + | |
| 41183 | +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. | |
| 41184 | +Object.setPrototypeOf(normalizeMethodRecord, null) | |
| 41185 | + | |
| 41186 | +/** | |
| 41187 | + * @see https://fetch.spec.whatwg.org/#concept-method-normalize | |
| 41188 | + * @param {string} method | |
| 41189 | + */ | |
| 41190 | +function normalizeMethod (method) { | |
| 41191 | + return normalizeMethodRecord[method.toLowerCase()] ?? method | |
| 41192 | +} | |
| 41193 | + | |
| 41194 | +// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string | |
| 41195 | +function serializeJavascriptValueToJSONString (value) { | |
| 41196 | + // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). | |
| 41197 | + const result = JSON.stringify(value) | |
| 41198 | + | |
| 41199 | + // 2. If result is undefined, then throw a TypeError. | |
| 41200 | + if (result === undefined) { | |
| 41201 | + throw new TypeError('Value is not JSON serializable') | |
| 41202 | + } | |
| 41203 | + | |
| 41204 | + // 3. Assert: result is a string. | |
| 41205 | + assert(typeof result === 'string') | |
| 41206 | + | |
| 41207 | + // 4. Return result. | |
| 41208 | + return result | |
| 41209 | +} | |
| 41210 | + | |
| 41211 | +// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object | |
| 41212 | +const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) | |
| 41213 | + | |
| 41214 | +/** | |
| 41215 | + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object | |
| 41216 | + * @param {() => unknown[]} iterator | |
| 41217 | + * @param {string} name name of the instance | |
| 41218 | + * @param {'key'|'value'|'key+value'} kind | |
| 41219 | + */ | |
| 41220 | +function makeIterator (iterator, name, kind) { | |
| 41221 | + const object = { | |
| 41222 | + index: 0, | |
| 41223 | + kind, | |
| 41224 | + target: iterator | |
| 41225 | + } | |
| 41226 | + | |
| 41227 | + const i = { | |
| 41228 | + next () { | |
| 41229 | + // 1. Let interface be the interface for which the iterator prototype object exists. | |
| 41230 | + | |
| 41231 | + // 2. Let thisValue be the this value. | |
| 41232 | + | |
| 41233 | + // 3. Let object be ? ToObject(thisValue). | |
| 41234 | + | |
| 41235 | + // 4. If object is a platform object, then perform a security | |
| 41236 | + // check, passing: | |
| 41237 | + | |
| 41238 | + // 5. If object is not a default iterator object for interface, | |
| 41239 | + // then throw a TypeError. | |
| 41240 | + if (Object.getPrototypeOf(this) !== i) { | |
| 41241 | + throw new TypeError( | |
| 41242 | + `'next' called on an object that does not implement interface ${name} Iterator.` | |
| 41243 | + ) | |
| 41244 | + } | |
| 41245 | + | |
| 41246 | + // 6. Let index be object’s index. | |
| 41247 | + // 7. Let kind be object’s kind. | |
| 41248 | + // 8. Let values be object’s target's value pairs to iterate over. | |
| 41249 | + const { index, kind, target } = object | |
| 41250 | + const values = target() | |
| 41251 | + | |
| 41252 | + // 9. Let len be the length of values. | |
| 41253 | + const len = values.length | |
| 41254 | + | |
| 41255 | + // 10. If index is greater than or equal to len, then return | |
| 41256 | + // CreateIterResultObject(undefined, true). | |
| 41257 | + if (index >= len) { | |
| 41258 | + return { value: undefined, done: true } | |
| 41259 | + } | |
| 41260 | + | |
| 41261 | + // 11. Let pair be the entry in values at index index. | |
| 41262 | + const pair = values[index] | |
| 41263 | + | |
| 41264 | + // 12. Set object’s index to index + 1. | |
| 41265 | + object.index = index + 1 | |
| 41266 | + | |
| 41267 | + // 13. Return the iterator result for pair and kind. | |
| 41268 | + return iteratorResult(pair, kind) | |
| 41269 | + }, | |
| 41270 | + // The class string of an iterator prototype object for a given interface is the | |
| 41271 | + // result of concatenating the identifier of the interface and the string " Iterator". | |
| 41272 | + [Symbol.toStringTag]: `${name} Iterator` | |
| 41273 | + } | |
| 41274 | + | |
| 41275 | + // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. | |
| 41276 | + Object.setPrototypeOf(i, esIteratorPrototype) | |
| 41277 | + // esIteratorPrototype needs to be the prototype of i | |
| 41278 | + // which is the prototype of an empty object. Yes, it's confusing. | |
| 41279 | + return Object.setPrototypeOf({}, i) | |
| 41280 | +} | |
| 41281 | + | |
| 41282 | +// https://webidl.spec.whatwg.org/#iterator-result | |
| 41283 | +function iteratorResult (pair, kind) { | |
| 41284 | + let result | |
| 41285 | + | |
| 41286 | + // 1. Let result be a value determined by the value of kind: | |
| 41287 | + switch (kind) { | |
| 41288 | + case 'key': { | |
| 41289 | + // 1. Let idlKey be pair’s key. | |
| 41290 | + // 2. Let key be the result of converting idlKey to an | |
| 41291 | + // ECMAScript value. | |
| 41292 | + // 3. result is key. | |
| 41293 | + result = pair[0] | |
| 41294 | + break | |
| 41295 | + } | |
| 41296 | + case 'value': { | |
| 41297 | + // 1. Let idlValue be pair’s value. | |
| 41298 | + // 2. Let value be the result of converting idlValue to | |
| 41299 | + // an ECMAScript value. | |
| 41300 | + // 3. result is value. | |
| 41301 | + result = pair[1] | |
| 41302 | + break | |
| 41303 | + } | |
| 41304 | + case 'key+value': { | |
| 41305 | + // 1. Let idlKey be pair’s key. | |
| 41306 | + // 2. Let idlValue be pair’s value. | |
| 41307 | + // 3. Let key be the result of converting idlKey to an | |
| 41308 | + // ECMAScript value. | |
| 41309 | + // 4. Let value be the result of converting idlValue to | |
| 41310 | + // an ECMAScript value. | |
| 41311 | + // 5. Let array be ! ArrayCreate(2). | |
| 41312 | + // 6. Call ! CreateDataProperty(array, "0", key). | |
| 41313 | + // 7. Call ! CreateDataProperty(array, "1", value). | |
| 41314 | + // 8. result is array. | |
| 41315 | + result = pair | |
| 41316 | + break | |
| 41317 | + } | |
| 41318 | + } | |
| 41319 | + | |
| 41320 | + // 2. Return CreateIterResultObject(result, false). | |
| 41321 | + return { value: result, done: false } | |
| 41322 | +} | |
| 41323 | + | |
| 41324 | +/** | |
| 41325 | + * @see https://fetch.spec.whatwg.org/#body-fully-read | |
| 41326 | + */ | |
| 41327 | +async function fullyReadBody (body, processBody, processBodyError) { | |
| 41328 | + // 1. If taskDestination is null, then set taskDestination to | |
| 41329 | + // the result of starting a new parallel queue. | |
| 41330 | + | |
| 41331 | + // 2. Let successSteps given a byte sequence bytes be to queue a | |
| 41332 | + // fetch task to run processBody given bytes, with taskDestination. | |
| 41333 | + const successSteps = processBody | |
| 41334 | + | |
| 41335 | + // 3. Let errorSteps be to queue a fetch task to run processBodyError, | |
| 41336 | + // with taskDestination. | |
| 41337 | + const errorSteps = processBodyError | |
| 41338 | + | |
| 41339 | + // 4. Let reader be the result of getting a reader for body’s stream. | |
| 41340 | + // If that threw an exception, then run errorSteps with that | |
| 41341 | + // exception and return. | |
| 41342 | + let reader | |
| 41343 | + | |
| 41344 | + try { | |
| 41345 | + reader = body.stream.getReader() | |
| 41346 | + } catch (e) { | |
| 41347 | + errorSteps(e) | |
| 41348 | + return | |
| 41349 | + } | |
| 41350 | + | |
| 41351 | + // 5. Read all bytes from reader, given successSteps and errorSteps. | |
| 41352 | + try { | |
| 41353 | + const result = await readAllBytes(reader) | |
| 41354 | + successSteps(result) | |
| 41355 | + } catch (e) { | |
| 41356 | + errorSteps(e) | |
| 41357 | + } | |
| 41358 | +} | |
| 41359 | + | |
| 41360 | +/** @type {ReadableStream} */ | |
| 41361 | +let ReadableStream = globalThis.ReadableStream | |
| 41362 | + | |
| 41363 | +function isReadableStreamLike (stream) { | |
| 41364 | + if (!ReadableStream) { | |
| 41365 | + ReadableStream = (__nccwpck_require__(3774).ReadableStream) | |
| 41366 | + } | |
| 41367 | + | |
| 41368 | + return stream instanceof ReadableStream || ( | |
| 41369 | + stream[Symbol.toStringTag] === 'ReadableStream' && | |
| 41370 | + typeof stream.tee === 'function' | |
| 41371 | + ) | |
| 41372 | +} | |
| 41373 | + | |
| 41374 | +const MAXIMUM_ARGUMENT_LENGTH = 65535 | |
| 41375 | + | |
| 41376 | +/** | |
| 41377 | + * @see https://infra.spec.whatwg.org/#isomorphic-decode | |
| 41378 | + * @param {number[]|Uint8Array} input | |
| 41379 | + */ | |
| 41380 | +function isomorphicDecode (input) { | |
| 41381 | + // 1. To isomorphic decode a byte sequence input, return a string whose code point | |
| 41382 | + // length is equal to input’s length and whose code points have the same values | |
| 41383 | + // as the values of input’s bytes, in the same order. | |
| 41384 | + | |
| 41385 | + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { | |
| 41386 | + return String.fromCharCode(...input) | |
| 41387 | + } | |
| 41388 | + | |
| 41389 | + return input.reduce((previous, current) => previous + String.fromCharCode(current), '') | |
| 41390 | +} | |
| 41391 | + | |
| 41392 | +/** | |
| 41393 | + * @param {ReadableStreamController<Uint8Array>} controller | |
| 41394 | + */ | |
| 41395 | +function readableStreamClose (controller) { | |
| 41396 | + try { | |
| 41397 | + controller.close() | |
| 41398 | + } catch (err) { | |
| 41399 | + // TODO: add comment explaining why this error occurs. | |
| 41400 | + if (!err.message.includes('Controller is already closed')) { | |
| 41401 | + throw err | |
| 41402 | + } | |
| 41403 | + } | |
| 41404 | +} | |
| 41405 | + | |
| 41406 | +/** | |
| 41407 | + * @see https://infra.spec.whatwg.org/#isomorphic-encode | |
| 41408 | + * @param {string} input | |
| 41409 | + */ | |
| 41410 | +function isomorphicEncode (input) { | |
| 41411 | + // 1. Assert: input contains no code points greater than U+00FF. | |
| 41412 | + for (let i = 0; i < input.length; i++) { | |
| 41413 | + assert(input.charCodeAt(i) <= 0xFF) | |
| 41414 | + } | |
| 41415 | + | |
| 41416 | + // 2. Return a byte sequence whose length is equal to input’s code | |
| 41417 | + // point length and whose bytes have the same values as the | |
| 41418 | + // values of input’s code points, in the same order | |
| 41419 | + return input | |
| 41420 | +} | |
| 41421 | + | |
| 41422 | +/** | |
| 41423 | + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes | |
| 41424 | + * @see https://streams.spec.whatwg.org/#read-loop | |
| 41425 | + * @param {ReadableStreamDefaultReader} reader | |
| 41426 | + */ | |
| 41427 | +async function readAllBytes (reader) { | |
| 41428 | + const bytes = [] | |
| 41429 | + let byteLength = 0 | |
| 41430 | + | |
| 41431 | + while (true) { | |
| 41432 | + const { done, value: chunk } = await reader.read() | |
| 41433 | + | |
| 41434 | + if (done) { | |
| 41435 | + // 1. Call successSteps with bytes. | |
| 41436 | + return Buffer.concat(bytes, byteLength) | |
| 41437 | + } | |
| 41438 | + | |
| 41439 | + // 1. If chunk is not a Uint8Array object, call failureSteps | |
| 41440 | + // with a TypeError and abort these steps. | |
| 41441 | + if (!isUint8Array(chunk)) { | |
| 41442 | + throw new TypeError('Received non-Uint8Array chunk') | |
| 41443 | + } | |
| 41444 | + | |
| 41445 | + // 2. Append the bytes represented by chunk to bytes. | |
| 41446 | + bytes.push(chunk) | |
| 41447 | + byteLength += chunk.length | |
| 41448 | + | |
| 41449 | + // 3. Read-loop given reader, bytes, successSteps, and failureSteps. | |
| 41450 | + } | |
| 41451 | +} | |
| 41452 | + | |
| 41453 | +/** | |
| 41454 | + * @see https://fetch.spec.whatwg.org/#is-local | |
| 41455 | + * @param {URL} url | |
| 41456 | + */ | |
| 41457 | +function urlIsLocal (url) { | |
| 41458 | + assert('protocol' in url) // ensure it's a url object | |
| 41459 | + | |
| 41460 | + const protocol = url.protocol | |
| 41461 | + | |
| 41462 | + return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' | |
| 41463 | +} | |
| 41464 | + | |
| 41465 | +/** | |
| 41466 | + * @param {string|URL} url | |
| 41467 | + */ | |
| 41468 | +function urlHasHttpsScheme (url) { | |
| 41469 | + if (typeof url === 'string') { | |
| 41470 | + return url.startsWith('https:') | |
| 41471 | + } | |
| 41472 | + | |
| 41473 | + return url.protocol === 'https:' | |
| 41474 | +} | |
| 41475 | + | |
| 41476 | +/** | |
| 41477 | + * @see https://fetch.spec.whatwg.org/#http-scheme | |
| 41478 | + * @param {URL} url | |
| 41479 | + */ | |
| 41480 | +function urlIsHttpHttpsScheme (url) { | |
| 41481 | + assert('protocol' in url) // ensure it's a url object | |
| 41482 | + | |
| 41483 | + const protocol = url.protocol | |
| 41484 | + | |
| 41485 | + return protocol === 'http:' || protocol === 'https:' | |
| 41486 | +} | |
| 41487 | + | |
| 41488 | +/** | |
| 41489 | + * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. | |
| 41490 | + */ | |
| 41491 | +const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) | |
| 41492 | + | |
| 41493 | +module.exports = { | |
| 41494 | + isAborted, | |
| 41495 | + isCancelled, | |
| 41496 | + createDeferredPromise, | |
| 41497 | + ReadableStreamFrom, | |
| 41498 | + toUSVString, | |
| 41499 | + tryUpgradeRequestToAPotentiallyTrustworthyURL, | |
| 41500 | + coarsenedSharedCurrentTime, | |
| 41501 | + determineRequestsReferrer, | |
| 41502 | + makePolicyContainer, | |
| 41503 | + clonePolicyContainer, | |
| 41504 | + appendFetchMetadata, | |
| 41505 | + appendRequestOriginHeader, | |
| 41506 | + TAOCheck, | |
| 41507 | + corsCheck, | |
| 41508 | + crossOriginResourcePolicyCheck, | |
| 41509 | + createOpaqueTimingInfo, | |
| 41510 | + setRequestReferrerPolicyOnRedirect, | |
| 41511 | + isValidHTTPToken, | |
| 41512 | + requestBadPort, | |
| 41513 | + requestCurrentURL, | |
| 41514 | + responseURL, | |
| 41515 | + responseLocationURL, | |
| 41516 | + isBlobLike, | |
| 41517 | + isURLPotentiallyTrustworthy, | |
| 41518 | + isValidReasonPhrase, | |
| 41519 | + sameOrigin, | |
| 41520 | + normalizeMethod, | |
| 41521 | + serializeJavascriptValueToJSONString, | |
| 41522 | + makeIterator, | |
| 41523 | + isValidHeaderName, | |
| 41524 | + isValidHeaderValue, | |
| 41525 | + hasOwn, | |
| 41526 | + isErrorLike, | |
| 41527 | + fullyReadBody, | |
| 41528 | + bytesMatch, | |
| 41529 | + isReadableStreamLike, | |
| 41530 | + readableStreamClose, | |
| 41531 | + isomorphicEncode, | |
| 41532 | + isomorphicDecode, | |
| 41533 | + urlIsLocal, | |
| 41534 | + urlHasHttpsScheme, | |
| 41535 | + urlIsHttpHttpsScheme, | |
| 41536 | + readAllBytes, | |
| 41537 | + normalizeMethodRecord, | |
| 41538 | + parseMetadata | |
| 41539 | +} | |
| 41540 | + | |
| 41541 | + | |
| 41542 | +/***/ }), | |
| 41543 | + | |
| 41544 | +/***/ 4222: | |
| 41545 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 41546 | + | |
| 41547 | +"use strict"; | |
| 41548 | + | |
| 41549 | + | |
| 41550 | +const { types } = __nccwpck_require__(9023) | |
| 41551 | +const { hasOwn, toUSVString } = __nccwpck_require__(5523) | |
| 41552 | + | |
| 41553 | +/** @type {import('../../types/webidl').Webidl} */ | |
| 41554 | +const webidl = {} | |
| 41555 | +webidl.converters = {} | |
| 41556 | +webidl.util = {} | |
| 41557 | +webidl.errors = {} | |
| 41558 | + | |
| 41559 | +webidl.errors.exception = function (message) { | |
| 41560 | + return new TypeError(`${message.header}: ${message.message}`) | |
| 41561 | +} | |
| 41562 | + | |
| 41563 | +webidl.errors.conversionFailed = function (context) { | |
| 41564 | + const plural = context.types.length === 1 ? '' : ' one of' | |
| 41565 | + const message = | |
| 41566 | + `${context.argument} could not be converted to` + | |
| 41567 | + `${plural}: ${context.types.join(', ')}.` | |
| 41568 | + | |
| 41569 | + return webidl.errors.exception({ | |
| 41570 | + header: context.prefix, | |
| 41571 | + message | |
| 41572 | + }) | |
| 41573 | +} | |
| 41574 | + | |
| 41575 | +webidl.errors.invalidArgument = function (context) { | |
| 41576 | + return webidl.errors.exception({ | |
| 41577 | + header: context.prefix, | |
| 41578 | + message: `"${context.value}" is an invalid ${context.type}.` | |
| 41579 | + }) | |
| 41580 | +} | |
| 41581 | + | |
| 41582 | +// https://webidl.spec.whatwg.org/#implements | |
| 41583 | +webidl.brandCheck = function (V, I, opts = undefined) { | |
| 41584 | + if (opts?.strict !== false && !(V instanceof I)) { | |
| 41585 | + throw new TypeError('Illegal invocation') | |
| 41586 | + } else { | |
| 41587 | + return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] | |
| 41588 | + } | |
| 41589 | +} | |
| 41590 | + | |
| 41591 | +webidl.argumentLengthCheck = function ({ length }, min, ctx) { | |
| 41592 | + if (length < min) { | |
| 41593 | + throw webidl.errors.exception({ | |
| 41594 | + message: `${min} argument${min !== 1 ? 's' : ''} required, ` + | |
| 41595 | + `but${length ? ' only' : ''} ${length} found.`, | |
| 41596 | + ...ctx | |
| 41597 | + }) | |
| 41598 | + } | |
| 41599 | +} | |
| 41600 | + | |
| 41601 | +webidl.illegalConstructor = function () { | |
| 41602 | + throw webidl.errors.exception({ | |
| 41603 | + header: 'TypeError', | |
| 41604 | + message: 'Illegal constructor' | |
| 41605 | + }) | |
| 41606 | +} | |
| 41607 | + | |
| 41608 | +// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values | |
| 41609 | +webidl.util.Type = function (V) { | |
| 41610 | + switch (typeof V) { | |
| 41611 | + case 'undefined': return 'Undefined' | |
| 41612 | + case 'boolean': return 'Boolean' | |
| 41613 | + case 'string': return 'String' | |
| 41614 | + case 'symbol': return 'Symbol' | |
| 41615 | + case 'number': return 'Number' | |
| 41616 | + case 'bigint': return 'BigInt' | |
| 41617 | + case 'function': | |
| 41618 | + case 'object': { | |
| 41619 | + if (V === null) { | |
| 41620 | + return 'Null' | |
| 41621 | + } | |
| 41622 | + | |
| 41623 | + return 'Object' | |
| 41624 | + } | |
| 41625 | + } | |
| 41626 | +} | |
| 41627 | + | |
| 41628 | +// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint | |
| 41629 | +webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { | |
| 41630 | + let upperBound | |
| 41631 | + let lowerBound | |
| 41632 | + | |
| 41633 | + // 1. If bitLength is 64, then: | |
| 41634 | + if (bitLength === 64) { | |
| 41635 | + // 1. Let upperBound be 2^53 − 1. | |
| 41636 | + upperBound = Math.pow(2, 53) - 1 | |
| 41637 | + | |
| 41638 | + // 2. If signedness is "unsigned", then let lowerBound be 0. | |
| 41639 | + if (signedness === 'unsigned') { | |
| 41640 | + lowerBound = 0 | |
| 41641 | + } else { | |
| 41642 | + // 3. Otherwise let lowerBound be −2^53 + 1. | |
| 41643 | + lowerBound = Math.pow(-2, 53) + 1 | |
| 41644 | + } | |
| 41645 | + } else if (signedness === 'unsigned') { | |
| 41646 | + // 2. Otherwise, if signedness is "unsigned", then: | |
| 41647 | + | |
| 41648 | + // 1. Let lowerBound be 0. | |
| 41649 | + lowerBound = 0 | |
| 41650 | + | |
| 41651 | + // 2. Let upperBound be 2^bitLength − 1. | |
| 41652 | + upperBound = Math.pow(2, bitLength) - 1 | |
| 41653 | + } else { | |
| 41654 | + // 3. Otherwise: | |
| 41655 | + | |
| 41656 | + // 1. Let lowerBound be -2^bitLength − 1. | |
| 41657 | + lowerBound = Math.pow(-2, bitLength) - 1 | |
| 41658 | + | |
| 41659 | + // 2. Let upperBound be 2^bitLength − 1 − 1. | |
| 41660 | + upperBound = Math.pow(2, bitLength - 1) - 1 | |
| 41661 | + } | |
| 41662 | + | |
| 41663 | + // 4. Let x be ? ToNumber(V). | |
| 41664 | + let x = Number(V) | |
| 41665 | + | |
| 41666 | + // 5. If x is −0, then set x to +0. | |
| 41667 | + if (x === 0) { | |
| 41668 | + x = 0 | |
| 41669 | + } | |
| 41670 | + | |
| 41671 | + // 6. If the conversion is to an IDL type associated | |
| 41672 | + // with the [EnforceRange] extended attribute, then: | |
| 41673 | + if (opts.enforceRange === true) { | |
| 41674 | + // 1. If x is NaN, +∞, or −∞, then throw a TypeError. | |
| 41675 | + if ( | |
| 41676 | + Number.isNaN(x) || | |
| 41677 | + x === Number.POSITIVE_INFINITY || | |
| 41678 | + x === Number.NEGATIVE_INFINITY | |
| 41679 | + ) { | |
| 41680 | + throw webidl.errors.exception({ | |
| 41681 | + header: 'Integer conversion', | |
| 41682 | + message: `Could not convert ${V} to an integer.` | |
| 41683 | + }) | |
| 41684 | + } | |
| 41685 | + | |
| 41686 | + // 2. Set x to IntegerPart(x). | |
| 41687 | + x = webidl.util.IntegerPart(x) | |
| 41688 | + | |
| 41689 | + // 3. If x < lowerBound or x > upperBound, then | |
| 41690 | + // throw a TypeError. | |
| 41691 | + if (x < lowerBound || x > upperBound) { | |
| 41692 | + throw webidl.errors.exception({ | |
| 41693 | + header: 'Integer conversion', | |
| 41694 | + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` | |
| 41695 | + }) | |
| 41696 | + } | |
| 41697 | + | |
| 41698 | + // 4. Return x. | |
| 41699 | + return x | |
| 41700 | + } | |
| 41701 | + | |
| 41702 | + // 7. If x is not NaN and the conversion is to an IDL | |
| 41703 | + // type associated with the [Clamp] extended | |
| 41704 | + // attribute, then: | |
| 41705 | + if (!Number.isNaN(x) && opts.clamp === true) { | |
| 41706 | + // 1. Set x to min(max(x, lowerBound), upperBound). | |
| 41707 | + x = Math.min(Math.max(x, lowerBound), upperBound) | |
| 41708 | + | |
| 41709 | + // 2. Round x to the nearest integer, choosing the | |
| 41710 | + // even integer if it lies halfway between two, | |
| 41711 | + // and choosing +0 rather than −0. | |
| 41712 | + if (Math.floor(x) % 2 === 0) { | |
| 41713 | + x = Math.floor(x) | |
| 41714 | + } else { | |
| 41715 | + x = Math.ceil(x) | |
| 41716 | + } | |
| 41717 | + | |
| 41718 | + // 3. Return x. | |
| 41719 | + return x | |
| 41720 | + } | |
| 41721 | + | |
| 41722 | + // 8. If x is NaN, +0, +∞, or −∞, then return +0. | |
| 41723 | + if ( | |
| 41724 | + Number.isNaN(x) || | |
| 41725 | + (x === 0 && Object.is(0, x)) || | |
| 41726 | + x === Number.POSITIVE_INFINITY || | |
| 41727 | + x === Number.NEGATIVE_INFINITY | |
| 41728 | + ) { | |
| 41729 | + return 0 | |
| 41730 | + } | |
| 41731 | + | |
| 41732 | + // 9. Set x to IntegerPart(x). | |
| 41733 | + x = webidl.util.IntegerPart(x) | |
| 41734 | + | |
| 41735 | + // 10. Set x to x modulo 2^bitLength. | |
| 41736 | + x = x % Math.pow(2, bitLength) | |
| 41737 | + | |
| 41738 | + // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, | |
| 41739 | + // then return x − 2^bitLength. | |
| 41740 | + if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { | |
| 41741 | + return x - Math.pow(2, bitLength) | |
| 41742 | + } | |
| 41743 | + | |
| 41744 | + // 12. Otherwise, return x. | |
| 41745 | + return x | |
| 41746 | +} | |
| 41747 | + | |
| 41748 | +// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart | |
| 41749 | +webidl.util.IntegerPart = function (n) { | |
| 41750 | + // 1. Let r be floor(abs(n)). | |
| 41751 | + const r = Math.floor(Math.abs(n)) | |
| 41752 | + | |
| 41753 | + // 2. If n < 0, then return -1 × r. | |
| 41754 | + if (n < 0) { | |
| 41755 | + return -1 * r | |
| 41756 | + } | |
| 41757 | + | |
| 41758 | + // 3. Otherwise, return r. | |
| 41759 | + return r | |
| 41760 | +} | |
| 41761 | + | |
| 41762 | +// https://webidl.spec.whatwg.org/#es-sequence | |
| 41763 | +webidl.sequenceConverter = function (converter) { | |
| 41764 | + return (V) => { | |
| 41765 | + // 1. If Type(V) is not Object, throw a TypeError. | |
| 41766 | + if (webidl.util.Type(V) !== 'Object') { | |
| 41767 | + throw webidl.errors.exception({ | |
| 41768 | + header: 'Sequence', | |
| 41769 | + message: `Value of type ${webidl.util.Type(V)} is not an Object.` | |
| 41770 | + }) | |
| 41771 | + } | |
| 41772 | + | |
| 41773 | + // 2. Let method be ? GetMethod(V, @@iterator). | |
| 41774 | + /** @type {Generator} */ | |
| 41775 | + const method = V?.[Symbol.iterator]?.() | |
| 41776 | + const seq = [] | |
| 41777 | + | |
| 41778 | + // 3. If method is undefined, throw a TypeError. | |
| 41779 | + if ( | |
| 41780 | + method === undefined || | |
| 41781 | + typeof method.next !== 'function' | |
| 41782 | + ) { | |
| 41783 | + throw webidl.errors.exception({ | |
| 41784 | + header: 'Sequence', | |
| 41785 | + message: 'Object is not an iterator.' | |
| 41786 | + }) | |
| 41787 | + } | |
| 41788 | + | |
| 41789 | + // https://webidl.spec.whatwg.org/#create-sequence-from-iterable | |
| 41790 | + while (true) { | |
| 41791 | + const { done, value } = method.next() | |
| 41792 | + | |
| 41793 | + if (done) { | |
| 41794 | + break | |
| 41795 | + } | |
| 41796 | + | |
| 41797 | + seq.push(converter(value)) | |
| 41798 | + } | |
| 41799 | + | |
| 41800 | + return seq | |
| 41801 | + } | |
| 41802 | +} | |
| 41803 | + | |
| 41804 | +// https://webidl.spec.whatwg.org/#es-to-record | |
| 41805 | +webidl.recordConverter = function (keyConverter, valueConverter) { | |
| 41806 | + return (O) => { | |
| 41807 | + // 1. If Type(O) is not Object, throw a TypeError. | |
| 41808 | + if (webidl.util.Type(O) !== 'Object') { | |
| 41809 | + throw webidl.errors.exception({ | |
| 41810 | + header: 'Record', | |
| 41811 | + message: `Value of type ${webidl.util.Type(O)} is not an Object.` | |
| 41812 | + }) | |
| 41813 | + } | |
| 41814 | + | |
| 41815 | + // 2. Let result be a new empty instance of record<K, V>. | |
| 41816 | + const result = {} | |
| 41817 | + | |
| 41818 | + if (!types.isProxy(O)) { | |
| 41819 | + // Object.keys only returns enumerable properties | |
| 41820 | + const keys = Object.keys(O) | |
| 41821 | + | |
| 41822 | + for (const key of keys) { | |
| 41823 | + // 1. Let typedKey be key converted to an IDL value of type K. | |
| 41824 | + const typedKey = keyConverter(key) | |
| 41825 | + | |
| 41826 | + // 2. Let value be ? Get(O, key). | |
| 41827 | + // 3. Let typedValue be value converted to an IDL value of type V. | |
| 41828 | + const typedValue = valueConverter(O[key]) | |
| 41829 | + | |
| 41830 | + // 4. Set result[typedKey] to typedValue. | |
| 41831 | + result[typedKey] = typedValue | |
| 41832 | + } | |
| 41833 | + | |
| 41834 | + // 5. Return result. | |
| 41835 | + return result | |
| 41836 | + } | |
| 41837 | + | |
| 41838 | + // 3. Let keys be ? O.[[OwnPropertyKeys]](). | |
| 41839 | + const keys = Reflect.ownKeys(O) | |
| 41840 | + | |
| 41841 | + // 4. For each key of keys. | |
| 41842 | + for (const key of keys) { | |
| 41843 | + // 1. Let desc be ? O.[[GetOwnProperty]](key). | |
| 41844 | + const desc = Reflect.getOwnPropertyDescriptor(O, key) | |
| 41845 | + | |
| 41846 | + // 2. If desc is not undefined and desc.[[Enumerable]] is true: | |
| 41847 | + if (desc?.enumerable) { | |
| 41848 | + // 1. Let typedKey be key converted to an IDL value of type K. | |
| 41849 | + const typedKey = keyConverter(key) | |
| 41850 | + | |
| 41851 | + // 2. Let value be ? Get(O, key). | |
| 41852 | + // 3. Let typedValue be value converted to an IDL value of type V. | |
| 41853 | + const typedValue = valueConverter(O[key]) | |
| 41854 | + | |
| 41855 | + // 4. Set result[typedKey] to typedValue. | |
| 41856 | + result[typedKey] = typedValue | |
| 41857 | + } | |
| 41858 | + } | |
| 41859 | + | |
| 41860 | + // 5. Return result. | |
| 41861 | + return result | |
| 41862 | + } | |
| 41863 | +} | |
| 41864 | + | |
| 41865 | +webidl.interfaceConverter = function (i) { | |
| 41866 | + return (V, opts = {}) => { | |
| 41867 | + if (opts.strict !== false && !(V instanceof i)) { | |
| 41868 | + throw webidl.errors.exception({ | |
| 41869 | + header: i.name, | |
| 41870 | + message: `Expected ${V} to be an instance of ${i.name}.` | |
| 41871 | + }) | |
| 41872 | + } | |
| 41873 | + | |
| 41874 | + return V | |
| 41875 | + } | |
| 41876 | +} | |
| 41877 | + | |
| 41878 | +webidl.dictionaryConverter = function (converters) { | |
| 41879 | + return (dictionary) => { | |
| 41880 | + const type = webidl.util.Type(dictionary) | |
| 41881 | + const dict = {} | |
| 41882 | + | |
| 41883 | + if (type === 'Null' || type === 'Undefined') { | |
| 41884 | + return dict | |
| 41885 | + } else if (type !== 'Object') { | |
| 41886 | + throw webidl.errors.exception({ | |
| 41887 | + header: 'Dictionary', | |
| 41888 | + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` | |
| 41889 | + }) | |
| 41890 | + } | |
| 41891 | + | |
| 41892 | + for (const options of converters) { | |
| 41893 | + const { key, defaultValue, required, converter } = options | |
| 41894 | + | |
| 41895 | + if (required === true) { | |
| 41896 | + if (!hasOwn(dictionary, key)) { | |
| 41897 | + throw webidl.errors.exception({ | |
| 41898 | + header: 'Dictionary', | |
| 41899 | + message: `Missing required key "${key}".` | |
| 41900 | + }) | |
| 41901 | + } | |
| 41902 | + } | |
| 41903 | + | |
| 41904 | + let value = dictionary[key] | |
| 41905 | + const hasDefault = hasOwn(options, 'defaultValue') | |
| 41906 | + | |
| 41907 | + // Only use defaultValue if value is undefined and | |
| 41908 | + // a defaultValue options was provided. | |
| 41909 | + if (hasDefault && value !== null) { | |
| 41910 | + value = value ?? defaultValue | |
| 41911 | + } | |
| 41912 | + | |
| 41913 | + // A key can be optional and have no default value. | |
| 41914 | + // When this happens, do not perform a conversion, | |
| 41915 | + // and do not assign the key a value. | |
| 41916 | + if (required || hasDefault || value !== undefined) { | |
| 41917 | + value = converter(value) | |
| 41918 | + | |
| 41919 | + if ( | |
| 41920 | + options.allowedValues && | |
| 41921 | + !options.allowedValues.includes(value) | |
| 41922 | + ) { | |
| 41923 | + throw webidl.errors.exception({ | |
| 41924 | + header: 'Dictionary', | |
| 41925 | + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` | |
| 41926 | + }) | |
| 41927 | + } | |
| 41928 | + | |
| 41929 | + dict[key] = value | |
| 41930 | + } | |
| 41931 | + } | |
| 41932 | + | |
| 41933 | + return dict | |
| 41934 | + } | |
| 41935 | +} | |
| 41936 | + | |
| 41937 | +webidl.nullableConverter = function (converter) { | |
| 41938 | + return (V) => { | |
| 41939 | + if (V === null) { | |
| 41940 | + return V | |
| 41941 | + } | |
| 41942 | + | |
| 41943 | + return converter(V) | |
| 41944 | + } | |
| 41945 | +} | |
| 41946 | + | |
| 41947 | +// https://webidl.spec.whatwg.org/#es-DOMString | |
| 41948 | +webidl.converters.DOMString = function (V, opts = {}) { | |
| 41949 | + // 1. If V is null and the conversion is to an IDL type | |
| 41950 | + // associated with the [LegacyNullToEmptyString] | |
| 41951 | + // extended attribute, then return the DOMString value | |
| 41952 | + // that represents the empty string. | |
| 41953 | + if (V === null && opts.legacyNullToEmptyString) { | |
| 41954 | + return '' | |
| 41955 | + } | |
| 41956 | + | |
| 41957 | + // 2. Let x be ? ToString(V). | |
| 41958 | + if (typeof V === 'symbol') { | |
| 41959 | + throw new TypeError('Could not convert argument of type symbol to string.') | |
| 41960 | + } | |
| 41961 | + | |
| 41962 | + // 3. Return the IDL DOMString value that represents the | |
| 41963 | + // same sequence of code units as the one the | |
| 41964 | + // ECMAScript String value x represents. | |
| 41965 | + return String(V) | |
| 41966 | +} | |
| 41967 | + | |
| 41968 | +// https://webidl.spec.whatwg.org/#es-ByteString | |
| 41969 | +webidl.converters.ByteString = function (V) { | |
| 41970 | + // 1. Let x be ? ToString(V). | |
| 41971 | + // Note: DOMString converter perform ? ToString(V) | |
| 41972 | + const x = webidl.converters.DOMString(V) | |
| 41973 | + | |
| 41974 | + // 2. If the value of any element of x is greater than | |
| 41975 | + // 255, then throw a TypeError. | |
| 41976 | + for (let index = 0; index < x.length; index++) { | |
| 41977 | + if (x.charCodeAt(index) > 255) { | |
| 41978 | + throw new TypeError( | |
| 41979 | + 'Cannot convert argument to a ByteString because the character at ' + | |
| 41980 | + `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` | |
| 41981 | + ) | |
| 41982 | + } | |
| 41983 | + } | |
| 41984 | + | |
| 41985 | + // 3. Return an IDL ByteString value whose length is the | |
| 41986 | + // length of x, and where the value of each element is | |
| 41987 | + // the value of the corresponding element of x. | |
| 41988 | + return x | |
| 41989 | +} | |
| 41990 | + | |
| 41991 | +// https://webidl.spec.whatwg.org/#es-USVString | |
| 41992 | +webidl.converters.USVString = toUSVString | |
| 41993 | + | |
| 41994 | +// https://webidl.spec.whatwg.org/#es-boolean | |
| 41995 | +webidl.converters.boolean = function (V) { | |
| 41996 | + // 1. Let x be the result of computing ToBoolean(V). | |
| 41997 | + const x = Boolean(V) | |
| 41998 | + | |
| 41999 | + // 2. Return the IDL boolean value that is the one that represents | |
| 42000 | + // the same truth value as the ECMAScript Boolean value x. | |
| 42001 | + return x | |
| 42002 | +} | |
| 42003 | + | |
| 42004 | +// https://webidl.spec.whatwg.org/#es-any | |
| 42005 | +webidl.converters.any = function (V) { | |
| 42006 | + return V | |
| 42007 | +} | |
| 42008 | + | |
| 42009 | +// https://webidl.spec.whatwg.org/#es-long-long | |
| 42010 | +webidl.converters['long long'] = function (V) { | |
| 42011 | + // 1. Let x be ? ConvertToInt(V, 64, "signed"). | |
| 42012 | + const x = webidl.util.ConvertToInt(V, 64, 'signed') | |
| 42013 | + | |
| 42014 | + // 2. Return the IDL long long value that represents | |
| 42015 | + // the same numeric value as x. | |
| 42016 | + return x | |
| 42017 | +} | |
| 42018 | + | |
| 42019 | +// https://webidl.spec.whatwg.org/#es-unsigned-long-long | |
| 42020 | +webidl.converters['unsigned long long'] = function (V) { | |
| 42021 | + // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). | |
| 42022 | + const x = webidl.util.ConvertToInt(V, 64, 'unsigned') | |
| 42023 | + | |
| 42024 | + // 2. Return the IDL unsigned long long value that | |
| 42025 | + // represents the same numeric value as x. | |
| 42026 | + return x | |
| 42027 | +} | |
| 42028 | + | |
| 42029 | +// https://webidl.spec.whatwg.org/#es-unsigned-long | |
| 42030 | +webidl.converters['unsigned long'] = function (V) { | |
| 42031 | + // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). | |
| 42032 | + const x = webidl.util.ConvertToInt(V, 32, 'unsigned') | |
| 42033 | + | |
| 42034 | + // 2. Return the IDL unsigned long value that | |
| 42035 | + // represents the same numeric value as x. | |
| 42036 | + return x | |
| 42037 | +} | |
| 42038 | + | |
| 42039 | +// https://webidl.spec.whatwg.org/#es-unsigned-short | |
| 42040 | +webidl.converters['unsigned short'] = function (V, opts) { | |
| 42041 | + // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). | |
| 42042 | + const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) | |
| 42043 | + | |
| 42044 | + // 2. Return the IDL unsigned short value that represents | |
| 42045 | + // the same numeric value as x. | |
| 42046 | + return x | |
| 42047 | +} | |
| 42048 | + | |
| 42049 | +// https://webidl.spec.whatwg.org/#idl-ArrayBuffer | |
| 42050 | +webidl.converters.ArrayBuffer = function (V, opts = {}) { | |
| 42051 | + // 1. If Type(V) is not Object, or V does not have an | |
| 42052 | + // [[ArrayBufferData]] internal slot, then throw a | |
| 42053 | + // TypeError. | |
| 42054 | + // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances | |
| 42055 | + // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances | |
| 42056 | + if ( | |
| 42057 | + webidl.util.Type(V) !== 'Object' || | |
| 42058 | + !types.isAnyArrayBuffer(V) | |
| 42059 | + ) { | |
| 42060 | + throw webidl.errors.conversionFailed({ | |
| 42061 | + prefix: `${V}`, | |
| 42062 | + argument: `${V}`, | |
| 42063 | + types: ['ArrayBuffer'] | |
| 42064 | + }) | |
| 42065 | + } | |
| 42066 | + | |
| 42067 | + // 2. If the conversion is not to an IDL type associated | |
| 42068 | + // with the [AllowShared] extended attribute, and | |
| 42069 | + // IsSharedArrayBuffer(V) is true, then throw a | |
| 42070 | + // TypeError. | |
| 42071 | + if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { | |
| 42072 | + throw webidl.errors.exception({ | |
| 42073 | + header: 'ArrayBuffer', | |
| 42074 | + message: 'SharedArrayBuffer is not allowed.' | |
| 42075 | + }) | |
| 42076 | + } | |
| 42077 | + | |
| 42078 | + // 3. If the conversion is not to an IDL type associated | |
| 42079 | + // with the [AllowResizable] extended attribute, and | |
| 42080 | + // IsResizableArrayBuffer(V) is true, then throw a | |
| 42081 | + // TypeError. | |
| 42082 | + // Note: resizable ArrayBuffers are currently a proposal. | |
| 42083 | + | |
| 42084 | + // 4. Return the IDL ArrayBuffer value that is a | |
| 42085 | + // reference to the same object as V. | |
| 42086 | + return V | |
| 42087 | +} | |
| 42088 | + | |
| 42089 | +webidl.converters.TypedArray = function (V, T, opts = {}) { | |
| 42090 | + // 1. Let T be the IDL type V is being converted to. | |
| 42091 | + | |
| 42092 | + // 2. If Type(V) is not Object, or V does not have a | |
| 42093 | + // [[TypedArrayName]] internal slot with a value | |
| 42094 | + // equal to T’s name, then throw a TypeError. | |
| 42095 | + if ( | |
| 42096 | + webidl.util.Type(V) !== 'Object' || | |
| 42097 | + !types.isTypedArray(V) || | |
| 42098 | + V.constructor.name !== T.name | |
| 42099 | + ) { | |
| 42100 | + throw webidl.errors.conversionFailed({ | |
| 42101 | + prefix: `${T.name}`, | |
| 42102 | + argument: `${V}`, | |
| 42103 | + types: [T.name] | |
| 42104 | + }) | |
| 42105 | + } | |
| 42106 | + | |
| 42107 | + // 3. If the conversion is not to an IDL type associated | |
| 42108 | + // with the [AllowShared] extended attribute, and | |
| 42109 | + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is | |
| 42110 | + // true, then throw a TypeError. | |
| 42111 | + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { | |
| 42112 | + throw webidl.errors.exception({ | |
| 42113 | + header: 'ArrayBuffer', | |
| 42114 | + message: 'SharedArrayBuffer is not allowed.' | |
| 42115 | + }) | |
| 42116 | + } | |
| 42117 | + | |
| 42118 | + // 4. If the conversion is not to an IDL type associated | |
| 42119 | + // with the [AllowResizable] extended attribute, and | |
| 42120 | + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is | |
| 42121 | + // true, then throw a TypeError. | |
| 42122 | + // Note: resizable array buffers are currently a proposal | |
| 42123 | + | |
| 42124 | + // 5. Return the IDL value of type T that is a reference | |
| 42125 | + // to the same object as V. | |
| 42126 | + return V | |
| 42127 | +} | |
| 42128 | + | |
| 42129 | +webidl.converters.DataView = function (V, opts = {}) { | |
| 42130 | + // 1. If Type(V) is not Object, or V does not have a | |
| 42131 | + // [[DataView]] internal slot, then throw a TypeError. | |
| 42132 | + if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { | |
| 42133 | + throw webidl.errors.exception({ | |
| 42134 | + header: 'DataView', | |
| 42135 | + message: 'Object is not a DataView.' | |
| 42136 | + }) | |
| 42137 | + } | |
| 42138 | + | |
| 42139 | + // 2. If the conversion is not to an IDL type associated | |
| 42140 | + // with the [AllowShared] extended attribute, and | |
| 42141 | + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, | |
| 42142 | + // then throw a TypeError. | |
| 42143 | + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { | |
| 42144 | + throw webidl.errors.exception({ | |
| 42145 | + header: 'ArrayBuffer', | |
| 42146 | + message: 'SharedArrayBuffer is not allowed.' | |
| 42147 | + }) | |
| 42148 | + } | |
| 42149 | + | |
| 42150 | + // 3. If the conversion is not to an IDL type associated | |
| 42151 | + // with the [AllowResizable] extended attribute, and | |
| 42152 | + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is | |
| 42153 | + // true, then throw a TypeError. | |
| 42154 | + // Note: resizable ArrayBuffers are currently a proposal | |
| 42155 | + | |
| 42156 | + // 4. Return the IDL DataView value that is a reference | |
| 42157 | + // to the same object as V. | |
| 42158 | + return V | |
| 42159 | +} | |
| 42160 | + | |
| 42161 | +// https://webidl.spec.whatwg.org/#BufferSource | |
| 42162 | +webidl.converters.BufferSource = function (V, opts = {}) { | |
| 42163 | + if (types.isAnyArrayBuffer(V)) { | |
| 42164 | + return webidl.converters.ArrayBuffer(V, opts) | |
| 42165 | + } | |
| 42166 | + | |
| 42167 | + if (types.isTypedArray(V)) { | |
| 42168 | + return webidl.converters.TypedArray(V, V.constructor) | |
| 42169 | + } | |
| 42170 | + | |
| 42171 | + if (types.isDataView(V)) { | |
| 42172 | + return webidl.converters.DataView(V, opts) | |
| 42173 | + } | |
| 42174 | + | |
| 42175 | + throw new TypeError(`Could not convert ${V} to a BufferSource.`) | |
| 42176 | +} | |
| 42177 | + | |
| 42178 | +webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter( | |
| 42179 | + webidl.converters.ByteString | |
| 42180 | +) | |
| 42181 | + | |
| 42182 | +webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter( | |
| 42183 | + webidl.converters['sequence<ByteString>'] | |
| 42184 | +) | |
| 42185 | + | |
| 42186 | +webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter( | |
| 42187 | + webidl.converters.ByteString, | |
| 42188 | + webidl.converters.ByteString | |
| 42189 | +) | |
| 42190 | + | |
| 42191 | +module.exports = { | |
| 42192 | + webidl | |
| 42193 | +} | |
| 42194 | + | |
| 42195 | + | |
| 42196 | +/***/ }), | |
| 42197 | + | |
| 42198 | +/***/ 396: | |
| 42199 | +/***/ ((module) => { | |
| 42200 | + | |
| 42201 | +"use strict"; | |
| 42202 | + | |
| 42203 | + | |
| 42204 | +/** | |
| 42205 | + * @see https://encoding.spec.whatwg.org/#concept-encoding-get | |
| 42206 | + * @param {string|undefined} label | |
| 42207 | + */ | |
| 42208 | +function getEncoding (label) { | |
| 42209 | + if (!label) { | |
| 42210 | + return 'failure' | |
| 42211 | + } | |
| 42212 | + | |
| 42213 | + // 1. Remove any leading and trailing ASCII whitespace from label. | |
| 42214 | + // 2. If label is an ASCII case-insensitive match for any of the | |
| 42215 | + // labels listed in the table below, then return the | |
| 42216 | + // corresponding encoding; otherwise return failure. | |
| 42217 | + switch (label.trim().toLowerCase()) { | |
| 42218 | + case 'unicode-1-1-utf-8': | |
| 42219 | + case 'unicode11utf8': | |
| 42220 | + case 'unicode20utf8': | |
| 42221 | + case 'utf-8': | |
| 42222 | + case 'utf8': | |
| 42223 | + case 'x-unicode20utf8': | |
| 42224 | + return 'UTF-8' | |
| 42225 | + case '866': | |
| 42226 | + case 'cp866': | |
| 42227 | + case 'csibm866': | |
| 42228 | + case 'ibm866': | |
| 42229 | + return 'IBM866' | |
| 42230 | + case 'csisolatin2': | |
| 42231 | + case 'iso-8859-2': | |
| 42232 | + case 'iso-ir-101': | |
| 42233 | + case 'iso8859-2': | |
| 42234 | + case 'iso88592': | |
| 42235 | + case 'iso_8859-2': | |
| 42236 | + case 'iso_8859-2:1987': | |
| 42237 | + case 'l2': | |
| 42238 | + case 'latin2': | |
| 42239 | + return 'ISO-8859-2' | |
| 42240 | + case 'csisolatin3': | |
| 42241 | + case 'iso-8859-3': | |
| 42242 | + case 'iso-ir-109': | |
| 42243 | + case 'iso8859-3': | |
| 42244 | + case 'iso88593': | |
| 42245 | + case 'iso_8859-3': | |
| 42246 | + case 'iso_8859-3:1988': | |
| 42247 | + case 'l3': | |
| 42248 | + case 'latin3': | |
| 42249 | + return 'ISO-8859-3' | |
| 42250 | + case 'csisolatin4': | |
| 42251 | + case 'iso-8859-4': | |
| 42252 | + case 'iso-ir-110': | |
| 42253 | + case 'iso8859-4': | |
| 42254 | + case 'iso88594': | |
| 42255 | + case 'iso_8859-4': | |
| 42256 | + case 'iso_8859-4:1988': | |
| 42257 | + case 'l4': | |
| 42258 | + case 'latin4': | |
| 42259 | + return 'ISO-8859-4' | |
| 42260 | + case 'csisolatincyrillic': | |
| 42261 | + case 'cyrillic': | |
| 42262 | + case 'iso-8859-5': | |
| 42263 | + case 'iso-ir-144': | |
| 42264 | + case 'iso8859-5': | |
| 42265 | + case 'iso88595': | |
| 42266 | + case 'iso_8859-5': | |
| 42267 | + case 'iso_8859-5:1988': | |
| 42268 | + return 'ISO-8859-5' | |
| 42269 | + case 'arabic': | |
| 42270 | + case 'asmo-708': | |
| 42271 | + case 'csiso88596e': | |
| 42272 | + case 'csiso88596i': | |
| 42273 | + case 'csisolatinarabic': | |
| 42274 | + case 'ecma-114': | |
| 42275 | + case 'iso-8859-6': | |
| 42276 | + case 'iso-8859-6-e': | |
| 42277 | + case 'iso-8859-6-i': | |
| 42278 | + case 'iso-ir-127': | |
| 42279 | + case 'iso8859-6': | |
| 42280 | + case 'iso88596': | |
| 42281 | + case 'iso_8859-6': | |
| 42282 | + case 'iso_8859-6:1987': | |
| 42283 | + return 'ISO-8859-6' | |
| 42284 | + case 'csisolatingreek': | |
| 42285 | + case 'ecma-118': | |
| 42286 | + case 'elot_928': | |
| 42287 | + case 'greek': | |
| 42288 | + case 'greek8': | |
| 42289 | + case 'iso-8859-7': | |
| 42290 | + case 'iso-ir-126': | |
| 42291 | + case 'iso8859-7': | |
| 42292 | + case 'iso88597': | |
| 42293 | + case 'iso_8859-7': | |
| 42294 | + case 'iso_8859-7:1987': | |
| 42295 | + case 'sun_eu_greek': | |
| 42296 | + return 'ISO-8859-7' | |
| 42297 | + case 'csiso88598e': | |
| 42298 | + case 'csisolatinhebrew': | |
| 42299 | + case 'hebrew': | |
| 42300 | + case 'iso-8859-8': | |
| 42301 | + case 'iso-8859-8-e': | |
| 42302 | + case 'iso-ir-138': | |
| 42303 | + case 'iso8859-8': | |
| 42304 | + case 'iso88598': | |
| 42305 | + case 'iso_8859-8': | |
| 42306 | + case 'iso_8859-8:1988': | |
| 42307 | + case 'visual': | |
| 42308 | + return 'ISO-8859-8' | |
| 42309 | + case 'csiso88598i': | |
| 42310 | + case 'iso-8859-8-i': | |
| 42311 | + case 'logical': | |
| 42312 | + return 'ISO-8859-8-I' | |
| 42313 | + case 'csisolatin6': | |
| 42314 | + case 'iso-8859-10': | |
| 42315 | + case 'iso-ir-157': | |
| 42316 | + case 'iso8859-10': | |
| 42317 | + case 'iso885910': | |
| 42318 | + case 'l6': | |
| 42319 | + case 'latin6': | |
| 42320 | + return 'ISO-8859-10' | |
| 42321 | + case 'iso-8859-13': | |
| 42322 | + case 'iso8859-13': | |
| 42323 | + case 'iso885913': | |
| 42324 | + return 'ISO-8859-13' | |
| 42325 | + case 'iso-8859-14': | |
| 42326 | + case 'iso8859-14': | |
| 42327 | + case 'iso885914': | |
| 42328 | + return 'ISO-8859-14' | |
| 42329 | + case 'csisolatin9': | |
| 42330 | + case 'iso-8859-15': | |
| 42331 | + case 'iso8859-15': | |
| 42332 | + case 'iso885915': | |
| 42333 | + case 'iso_8859-15': | |
| 42334 | + case 'l9': | |
| 42335 | + return 'ISO-8859-15' | |
| 42336 | + case 'iso-8859-16': | |
| 42337 | + return 'ISO-8859-16' | |
| 42338 | + case 'cskoi8r': | |
| 42339 | + case 'koi': | |
| 42340 | + case 'koi8': | |
| 42341 | + case 'koi8-r': | |
| 42342 | + case 'koi8_r': | |
| 42343 | + return 'KOI8-R' | |
| 42344 | + case 'koi8-ru': | |
| 42345 | + case 'koi8-u': | |
| 42346 | + return 'KOI8-U' | |
| 42347 | + case 'csmacintosh': | |
| 42348 | + case 'mac': | |
| 42349 | + case 'macintosh': | |
| 42350 | + case 'x-mac-roman': | |
| 42351 | + return 'macintosh' | |
| 42352 | + case 'iso-8859-11': | |
| 42353 | + case 'iso8859-11': | |
| 42354 | + case 'iso885911': | |
| 42355 | + case 'tis-620': | |
| 42356 | + case 'windows-874': | |
| 42357 | + return 'windows-874' | |
| 42358 | + case 'cp1250': | |
| 42359 | + case 'windows-1250': | |
| 42360 | + case 'x-cp1250': | |
| 42361 | + return 'windows-1250' | |
| 42362 | + case 'cp1251': | |
| 42363 | + case 'windows-1251': | |
| 42364 | + case 'x-cp1251': | |
| 42365 | + return 'windows-1251' | |
| 42366 | + case 'ansi_x3.4-1968': | |
| 42367 | + case 'ascii': | |
| 42368 | + case 'cp1252': | |
| 42369 | + case 'cp819': | |
| 42370 | + case 'csisolatin1': | |
| 42371 | + case 'ibm819': | |
| 42372 | + case 'iso-8859-1': | |
| 42373 | + case 'iso-ir-100': | |
| 42374 | + case 'iso8859-1': | |
| 42375 | + case 'iso88591': | |
| 42376 | + case 'iso_8859-1': | |
| 42377 | + case 'iso_8859-1:1987': | |
| 42378 | + case 'l1': | |
| 42379 | + case 'latin1': | |
| 42380 | + case 'us-ascii': | |
| 42381 | + case 'windows-1252': | |
| 42382 | + case 'x-cp1252': | |
| 42383 | + return 'windows-1252' | |
| 42384 | + case 'cp1253': | |
| 42385 | + case 'windows-1253': | |
| 42386 | + case 'x-cp1253': | |
| 42387 | + return 'windows-1253' | |
| 42388 | + case 'cp1254': | |
| 42389 | + case 'csisolatin5': | |
| 42390 | + case 'iso-8859-9': | |
| 42391 | + case 'iso-ir-148': | |
| 42392 | + case 'iso8859-9': | |
| 42393 | + case 'iso88599': | |
| 42394 | + case 'iso_8859-9': | |
| 42395 | + case 'iso_8859-9:1989': | |
| 42396 | + case 'l5': | |
| 42397 | + case 'latin5': | |
| 42398 | + case 'windows-1254': | |
| 42399 | + case 'x-cp1254': | |
| 42400 | + return 'windows-1254' | |
| 42401 | + case 'cp1255': | |
| 42402 | + case 'windows-1255': | |
| 42403 | + case 'x-cp1255': | |
| 42404 | + return 'windows-1255' | |
| 42405 | + case 'cp1256': | |
| 42406 | + case 'windows-1256': | |
| 42407 | + case 'x-cp1256': | |
| 42408 | + return 'windows-1256' | |
| 42409 | + case 'cp1257': | |
| 42410 | + case 'windows-1257': | |
| 42411 | + case 'x-cp1257': | |
| 42412 | + return 'windows-1257' | |
| 42413 | + case 'cp1258': | |
| 42414 | + case 'windows-1258': | |
| 42415 | + case 'x-cp1258': | |
| 42416 | + return 'windows-1258' | |
| 42417 | + case 'x-mac-cyrillic': | |
| 42418 | + case 'x-mac-ukrainian': | |
| 42419 | + return 'x-mac-cyrillic' | |
| 42420 | + case 'chinese': | |
| 42421 | + case 'csgb2312': | |
| 42422 | + case 'csiso58gb231280': | |
| 42423 | + case 'gb2312': | |
| 42424 | + case 'gb_2312': | |
| 42425 | + case 'gb_2312-80': | |
| 42426 | + case 'gbk': | |
| 42427 | + case 'iso-ir-58': | |
| 42428 | + case 'x-gbk': | |
| 42429 | + return 'GBK' | |
| 42430 | + case 'gb18030': | |
| 42431 | + return 'gb18030' | |
| 42432 | + case 'big5': | |
| 42433 | + case 'big5-hkscs': | |
| 42434 | + case 'cn-big5': | |
| 42435 | + case 'csbig5': | |
| 42436 | + case 'x-x-big5': | |
| 42437 | + return 'Big5' | |
| 42438 | + case 'cseucpkdfmtjapanese': | |
| 42439 | + case 'euc-jp': | |
| 42440 | + case 'x-euc-jp': | |
| 42441 | + return 'EUC-JP' | |
| 42442 | + case 'csiso2022jp': | |
| 42443 | + case 'iso-2022-jp': | |
| 42444 | + return 'ISO-2022-JP' | |
| 42445 | + case 'csshiftjis': | |
| 42446 | + case 'ms932': | |
| 42447 | + case 'ms_kanji': | |
| 42448 | + case 'shift-jis': | |
| 42449 | + case 'shift_jis': | |
| 42450 | + case 'sjis': | |
| 42451 | + case 'windows-31j': | |
| 42452 | + case 'x-sjis': | |
| 42453 | + return 'Shift_JIS' | |
| 42454 | + case 'cseuckr': | |
| 42455 | + case 'csksc56011987': | |
| 42456 | + case 'euc-kr': | |
| 42457 | + case 'iso-ir-149': | |
| 42458 | + case 'korean': | |
| 42459 | + case 'ks_c_5601-1987': | |
| 42460 | + case 'ks_c_5601-1989': | |
| 42461 | + case 'ksc5601': | |
| 42462 | + case 'ksc_5601': | |
| 42463 | + case 'windows-949': | |
| 42464 | + return 'EUC-KR' | |
| 42465 | + case 'csiso2022kr': | |
| 42466 | + case 'hz-gb-2312': | |
| 42467 | + case 'iso-2022-cn': | |
| 42468 | + case 'iso-2022-cn-ext': | |
| 42469 | + case 'iso-2022-kr': | |
| 42470 | + case 'replacement': | |
| 42471 | + return 'replacement' | |
| 42472 | + case 'unicodefffe': | |
| 42473 | + case 'utf-16be': | |
| 42474 | + return 'UTF-16BE' | |
| 42475 | + case 'csunicode': | |
| 42476 | + case 'iso-10646-ucs-2': | |
| 42477 | + case 'ucs-2': | |
| 42478 | + case 'unicode': | |
| 42479 | + case 'unicodefeff': | |
| 42480 | + case 'utf-16': | |
| 42481 | + case 'utf-16le': | |
| 42482 | + return 'UTF-16LE' | |
| 42483 | + case 'x-user-defined': | |
| 42484 | + return 'x-user-defined' | |
| 42485 | + default: return 'failure' | |
| 42486 | + } | |
| 42487 | +} | |
| 42488 | + | |
| 42489 | +module.exports = { | |
| 42490 | + getEncoding | |
| 42491 | +} | |
| 42492 | + | |
| 42493 | + | |
| 42494 | +/***/ }), | |
| 42495 | + | |
| 42496 | +/***/ 2160: | |
| 42497 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 42498 | + | |
| 42499 | +"use strict"; | |
| 42500 | + | |
| 42501 | + | |
| 42502 | +const { | |
| 42503 | + staticPropertyDescriptors, | |
| 42504 | + readOperation, | |
| 42505 | + fireAProgressEvent | |
| 42506 | +} = __nccwpck_require__(165) | |
| 42507 | +const { | |
| 42508 | + kState, | |
| 42509 | + kError, | |
| 42510 | + kResult, | |
| 42511 | + kEvents, | |
| 42512 | + kAborted | |
| 42513 | +} = __nccwpck_require__(6812) | |
| 42514 | +const { webidl } = __nccwpck_require__(4222) | |
| 42515 | +const { kEnumerableProperty } = __nccwpck_require__(3440) | |
| 42516 | + | |
| 42517 | +class FileReader extends EventTarget { | |
| 42518 | + constructor () { | |
| 42519 | + super() | |
| 42520 | + | |
| 42521 | + this[kState] = 'empty' | |
| 42522 | + this[kResult] = null | |
| 42523 | + this[kError] = null | |
| 42524 | + this[kEvents] = { | |
| 42525 | + loadend: null, | |
| 42526 | + error: null, | |
| 42527 | + abort: null, | |
| 42528 | + load: null, | |
| 42529 | + progress: null, | |
| 42530 | + loadstart: null | |
| 42531 | + } | |
| 42532 | + } | |
| 42533 | + | |
| 42534 | + /** | |
| 42535 | + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer | |
| 42536 | + * @param {import('buffer').Blob} blob | |
| 42537 | + */ | |
| 42538 | + readAsArrayBuffer (blob) { | |
| 42539 | + webidl.brandCheck(this, FileReader) | |
| 42540 | + | |
| 42541 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) | |
| 42542 | + | |
| 42543 | + blob = webidl.converters.Blob(blob, { strict: false }) | |
| 42544 | + | |
| 42545 | + // The readAsArrayBuffer(blob) method, when invoked, | |
| 42546 | + // must initiate a read operation for blob with ArrayBuffer. | |
| 42547 | + readOperation(this, blob, 'ArrayBuffer') | |
| 42548 | + } | |
| 42549 | + | |
| 42550 | + /** | |
| 42551 | + * @see https://w3c.github.io/FileAPI/#readAsBinaryString | |
| 42552 | + * @param {import('buffer').Blob} blob | |
| 42553 | + */ | |
| 42554 | + readAsBinaryString (blob) { | |
| 42555 | + webidl.brandCheck(this, FileReader) | |
| 42556 | + | |
| 42557 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) | |
| 42558 | + | |
| 42559 | + blob = webidl.converters.Blob(blob, { strict: false }) | |
| 42560 | + | |
| 42561 | + // The readAsBinaryString(blob) method, when invoked, | |
| 42562 | + // must initiate a read operation for blob with BinaryString. | |
| 42563 | + readOperation(this, blob, 'BinaryString') | |
| 42564 | + } | |
| 42565 | + | |
| 42566 | + /** | |
| 42567 | + * @see https://w3c.github.io/FileAPI/#readAsDataText | |
| 42568 | + * @param {import('buffer').Blob} blob | |
| 42569 | + * @param {string?} encoding | |
| 42570 | + */ | |
| 42571 | + readAsText (blob, encoding = undefined) { | |
| 42572 | + webidl.brandCheck(this, FileReader) | |
| 42573 | + | |
| 42574 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) | |
| 42575 | + | |
| 42576 | + blob = webidl.converters.Blob(blob, { strict: false }) | |
| 42577 | + | |
| 42578 | + if (encoding !== undefined) { | |
| 42579 | + encoding = webidl.converters.DOMString(encoding) | |
| 42580 | + } | |
| 42581 | + | |
| 42582 | + // The readAsText(blob, encoding) method, when invoked, | |
| 42583 | + // must initiate a read operation for blob with Text and encoding. | |
| 42584 | + readOperation(this, blob, 'Text', encoding) | |
| 42585 | + } | |
| 42586 | + | |
| 42587 | + /** | |
| 42588 | + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL | |
| 42589 | + * @param {import('buffer').Blob} blob | |
| 42590 | + */ | |
| 42591 | + readAsDataURL (blob) { | |
| 42592 | + webidl.brandCheck(this, FileReader) | |
| 42593 | + | |
| 42594 | + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) | |
| 42595 | + | |
| 42596 | + blob = webidl.converters.Blob(blob, { strict: false }) | |
| 42597 | + | |
| 42598 | + // The readAsDataURL(blob) method, when invoked, must | |
| 42599 | + // initiate a read operation for blob with DataURL. | |
| 42600 | + readOperation(this, blob, 'DataURL') | |
| 42601 | + } | |
| 42602 | + | |
| 42603 | + /** | |
| 42604 | + * @see https://w3c.github.io/FileAPI/#dfn-abort | |
| 42605 | + */ | |
| 42606 | + abort () { | |
| 42607 | + // 1. If this's state is "empty" or if this's state is | |
| 42608 | + // "done" set this's result to null and terminate | |
| 42609 | + // this algorithm. | |
| 42610 | + if (this[kState] === 'empty' || this[kState] === 'done') { | |
| 42611 | + this[kResult] = null | |
| 42612 | + return | |
| 42613 | + } | |
| 42614 | + | |
| 42615 | + // 2. If this's state is "loading" set this's state to | |
| 42616 | + // "done" and set this's result to null. | |
| 42617 | + if (this[kState] === 'loading') { | |
| 42618 | + this[kState] = 'done' | |
| 42619 | + this[kResult] = null | |
| 42620 | + } | |
| 42621 | + | |
| 42622 | + // 3. If there are any tasks from this on the file reading | |
| 42623 | + // task source in an affiliated task queue, then remove | |
| 42624 | + // those tasks from that task queue. | |
| 42625 | + this[kAborted] = true | |
| 42626 | + | |
| 42627 | + // 4. Terminate the algorithm for the read method being processed. | |
| 42628 | + // TODO | |
| 42629 | + | |
| 42630 | + // 5. Fire a progress event called abort at this. | |
| 42631 | + fireAProgressEvent('abort', this) | |
| 42632 | + | |
| 42633 | + // 6. If this's state is not "loading", fire a progress | |
| 42634 | + // event called loadend at this. | |
| 42635 | + if (this[kState] !== 'loading') { | |
| 42636 | + fireAProgressEvent('loadend', this) | |
| 42637 | + } | |
| 42638 | + } | |
| 42639 | + | |
| 42640 | + /** | |
| 42641 | + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate | |
| 42642 | + */ | |
| 42643 | + get readyState () { | |
| 42644 | + webidl.brandCheck(this, FileReader) | |
| 42645 | + | |
| 42646 | + switch (this[kState]) { | |
| 42647 | + case 'empty': return this.EMPTY | |
| 42648 | + case 'loading': return this.LOADING | |
| 42649 | + case 'done': return this.DONE | |
| 42650 | + } | |
| 42651 | + } | |
| 42652 | + | |
| 42653 | + /** | |
| 42654 | + * @see https://w3c.github.io/FileAPI/#dom-filereader-result | |
| 42655 | + */ | |
| 42656 | + get result () { | |
| 42657 | + webidl.brandCheck(this, FileReader) | |
| 42658 | + | |
| 42659 | + // The result attribute’s getter, when invoked, must return | |
| 42660 | + // this's result. | |
| 42661 | + return this[kResult] | |
| 42662 | + } | |
| 42663 | + | |
| 42664 | + /** | |
| 42665 | + * @see https://w3c.github.io/FileAPI/#dom-filereader-error | |
| 42666 | + */ | |
| 42667 | + get error () { | |
| 42668 | + webidl.brandCheck(this, FileReader) | |
| 42669 | + | |
| 42670 | + // The error attribute’s getter, when invoked, must return | |
| 42671 | + // this's error. | |
| 42672 | + return this[kError] | |
| 42673 | + } | |
| 42674 | + | |
| 42675 | + get onloadend () { | |
| 42676 | + webidl.brandCheck(this, FileReader) | |
| 42677 | + | |
| 42678 | + return this[kEvents].loadend | |
| 42679 | + } | |
| 42680 | + | |
| 42681 | + set onloadend (fn) { | |
| 42682 | + webidl.brandCheck(this, FileReader) | |
| 42683 | + | |
| 42684 | + if (this[kEvents].loadend) { | |
| 42685 | + this.removeEventListener('loadend', this[kEvents].loadend) | |
| 42686 | + } | |
| 42687 | + | |
| 42688 | + if (typeof fn === 'function') { | |
| 42689 | + this[kEvents].loadend = fn | |
| 42690 | + this.addEventListener('loadend', fn) | |
| 42691 | + } else { | |
| 42692 | + this[kEvents].loadend = null | |
| 42693 | + } | |
| 42694 | + } | |
| 42695 | + | |
| 42696 | + get onerror () { | |
| 42697 | + webidl.brandCheck(this, FileReader) | |
| 42698 | + | |
| 42699 | + return this[kEvents].error | |
| 42700 | + } | |
| 42701 | + | |
| 42702 | + set onerror (fn) { | |
| 42703 | + webidl.brandCheck(this, FileReader) | |
| 42704 | + | |
| 42705 | + if (this[kEvents].error) { | |
| 42706 | + this.removeEventListener('error', this[kEvents].error) | |
| 42707 | + } | |
| 42708 | + | |
| 42709 | + if (typeof fn === 'function') { | |
| 42710 | + this[kEvents].error = fn | |
| 42711 | + this.addEventListener('error', fn) | |
| 42712 | + } else { | |
| 42713 | + this[kEvents].error = null | |
| 42714 | + } | |
| 42715 | + } | |
| 42716 | + | |
| 42717 | + get onloadstart () { | |
| 42718 | + webidl.brandCheck(this, FileReader) | |
| 42719 | + | |
| 42720 | + return this[kEvents].loadstart | |
| 42721 | + } | |
| 42722 | + | |
| 42723 | + set onloadstart (fn) { | |
| 42724 | + webidl.brandCheck(this, FileReader) | |
| 42725 | + | |
| 42726 | + if (this[kEvents].loadstart) { | |
| 42727 | + this.removeEventListener('loadstart', this[kEvents].loadstart) | |
| 42728 | + } | |
| 42729 | + | |
| 42730 | + if (typeof fn === 'function') { | |
| 42731 | + this[kEvents].loadstart = fn | |
| 42732 | + this.addEventListener('loadstart', fn) | |
| 42733 | + } else { | |
| 42734 | + this[kEvents].loadstart = null | |
| 42735 | + } | |
| 42736 | + } | |
| 42737 | + | |
| 42738 | + get onprogress () { | |
| 42739 | + webidl.brandCheck(this, FileReader) | |
| 42740 | + | |
| 42741 | + return this[kEvents].progress | |
| 42742 | + } | |
| 42743 | + | |
| 42744 | + set onprogress (fn) { | |
| 42745 | + webidl.brandCheck(this, FileReader) | |
| 42746 | + | |
| 42747 | + if (this[kEvents].progress) { | |
| 42748 | + this.removeEventListener('progress', this[kEvents].progress) | |
| 42749 | + } | |
| 42750 | + | |
| 42751 | + if (typeof fn === 'function') { | |
| 42752 | + this[kEvents].progress = fn | |
| 42753 | + this.addEventListener('progress', fn) | |
| 42754 | + } else { | |
| 42755 | + this[kEvents].progress = null | |
| 42756 | + } | |
| 42757 | + } | |
| 42758 | + | |
| 42759 | + get onload () { | |
| 42760 | + webidl.brandCheck(this, FileReader) | |
| 42761 | + | |
| 42762 | + return this[kEvents].load | |
| 42763 | + } | |
| 42764 | + | |
| 42765 | + set onload (fn) { | |
| 42766 | + webidl.brandCheck(this, FileReader) | |
| 42767 | + | |
| 42768 | + if (this[kEvents].load) { | |
| 42769 | + this.removeEventListener('load', this[kEvents].load) | |
| 42770 | + } | |
| 42771 | + | |
| 42772 | + if (typeof fn === 'function') { | |
| 42773 | + this[kEvents].load = fn | |
| 42774 | + this.addEventListener('load', fn) | |
| 42775 | + } else { | |
| 42776 | + this[kEvents].load = null | |
| 42777 | + } | |
| 42778 | + } | |
| 42779 | + | |
| 42780 | + get onabort () { | |
| 42781 | + webidl.brandCheck(this, FileReader) | |
| 42782 | + | |
| 42783 | + return this[kEvents].abort | |
| 42784 | + } | |
| 42785 | + | |
| 42786 | + set onabort (fn) { | |
| 42787 | + webidl.brandCheck(this, FileReader) | |
| 42788 | + | |
| 42789 | + if (this[kEvents].abort) { | |
| 42790 | + this.removeEventListener('abort', this[kEvents].abort) | |
| 42791 | + } | |
| 42792 | + | |
| 42793 | + if (typeof fn === 'function') { | |
| 42794 | + this[kEvents].abort = fn | |
| 42795 | + this.addEventListener('abort', fn) | |
| 42796 | + } else { | |
| 42797 | + this[kEvents].abort = null | |
| 42798 | + } | |
| 42799 | + } | |
| 42800 | +} | |
| 42801 | + | |
| 42802 | +// https://w3c.github.io/FileAPI/#dom-filereader-empty | |
| 42803 | +FileReader.EMPTY = FileReader.prototype.EMPTY = 0 | |
| 42804 | +// https://w3c.github.io/FileAPI/#dom-filereader-loading | |
| 42805 | +FileReader.LOADING = FileReader.prototype.LOADING = 1 | |
| 42806 | +// https://w3c.github.io/FileAPI/#dom-filereader-done | |
| 42807 | +FileReader.DONE = FileReader.prototype.DONE = 2 | |
| 42808 | + | |
| 42809 | +Object.defineProperties(FileReader.prototype, { | |
| 42810 | + EMPTY: staticPropertyDescriptors, | |
| 42811 | + LOADING: staticPropertyDescriptors, | |
| 42812 | + DONE: staticPropertyDescriptors, | |
| 42813 | + readAsArrayBuffer: kEnumerableProperty, | |
| 42814 | + readAsBinaryString: kEnumerableProperty, | |
| 42815 | + readAsText: kEnumerableProperty, | |
| 42816 | + readAsDataURL: kEnumerableProperty, | |
| 42817 | + abort: kEnumerableProperty, | |
| 42818 | + readyState: kEnumerableProperty, | |
| 42819 | + result: kEnumerableProperty, | |
| 42820 | + error: kEnumerableProperty, | |
| 42821 | + onloadstart: kEnumerableProperty, | |
| 42822 | + onprogress: kEnumerableProperty, | |
| 42823 | + onload: kEnumerableProperty, | |
| 42824 | + onabort: kEnumerableProperty, | |
| 42825 | + onerror: kEnumerableProperty, | |
| 42826 | + onloadend: kEnumerableProperty, | |
| 42827 | + [Symbol.toStringTag]: { | |
| 42828 | + value: 'FileReader', | |
| 42829 | + writable: false, | |
| 42830 | + enumerable: false, | |
| 42831 | + configurable: true | |
| 42832 | + } | |
| 42833 | +}) | |
| 42834 | + | |
| 42835 | +Object.defineProperties(FileReader, { | |
| 42836 | + EMPTY: staticPropertyDescriptors, | |
| 42837 | + LOADING: staticPropertyDescriptors, | |
| 42838 | + DONE: staticPropertyDescriptors | |
| 42839 | +}) | |
| 42840 | + | |
| 42841 | +module.exports = { | |
| 42842 | + FileReader | |
| 42843 | +} | |
| 42844 | + | |
| 42845 | + | |
| 42846 | +/***/ }), | |
| 42847 | + | |
| 42848 | +/***/ 5976: | |
| 42849 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 42850 | + | |
| 42851 | +"use strict"; | |
| 42852 | + | |
| 42853 | + | |
| 42854 | +const { webidl } = __nccwpck_require__(4222) | |
| 42855 | + | |
| 42856 | +const kState = Symbol('ProgressEvent state') | |
| 42857 | + | |
| 42858 | +/** | |
| 42859 | + * @see https://xhr.spec.whatwg.org/#progressevent | |
| 42860 | + */ | |
| 42861 | +class ProgressEvent extends Event { | |
| 42862 | + constructor (type, eventInitDict = {}) { | |
| 42863 | + type = webidl.converters.DOMString(type) | |
| 42864 | + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) | |
| 42865 | + | |
| 42866 | + super(type, eventInitDict) | |
| 42867 | + | |
| 42868 | + this[kState] = { | |
| 42869 | + lengthComputable: eventInitDict.lengthComputable, | |
| 42870 | + loaded: eventInitDict.loaded, | |
| 42871 | + total: eventInitDict.total | |
| 42872 | + } | |
| 42873 | + } | |
| 42874 | + | |
| 42875 | + get lengthComputable () { | |
| 42876 | + webidl.brandCheck(this, ProgressEvent) | |
| 42877 | + | |
| 42878 | + return this[kState].lengthComputable | |
| 42879 | + } | |
| 42880 | + | |
| 42881 | + get loaded () { | |
| 42882 | + webidl.brandCheck(this, ProgressEvent) | |
| 42883 | + | |
| 42884 | + return this[kState].loaded | |
| 42885 | + } | |
| 42886 | + | |
| 42887 | + get total () { | |
| 42888 | + webidl.brandCheck(this, ProgressEvent) | |
| 42889 | + | |
| 42890 | + return this[kState].total | |
| 42891 | + } | |
| 42892 | +} | |
| 42893 | + | |
| 42894 | +webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ | |
| 42895 | + { | |
| 42896 | + key: 'lengthComputable', | |
| 42897 | + converter: webidl.converters.boolean, | |
| 42898 | + defaultValue: false | |
| 42899 | + }, | |
| 42900 | + { | |
| 42901 | + key: 'loaded', | |
| 42902 | + converter: webidl.converters['unsigned long long'], | |
| 42903 | + defaultValue: 0 | |
| 42904 | + }, | |
| 42905 | + { | |
| 42906 | + key: 'total', | |
| 42907 | + converter: webidl.converters['unsigned long long'], | |
| 42908 | + defaultValue: 0 | |
| 42909 | + }, | |
| 42910 | + { | |
| 42911 | + key: 'bubbles', | |
| 42912 | + converter: webidl.converters.boolean, | |
| 42913 | + defaultValue: false | |
| 42914 | + }, | |
| 42915 | + { | |
| 42916 | + key: 'cancelable', | |
| 42917 | + converter: webidl.converters.boolean, | |
| 42918 | + defaultValue: false | |
| 42919 | + }, | |
| 42920 | + { | |
| 42921 | + key: 'composed', | |
| 42922 | + converter: webidl.converters.boolean, | |
| 42923 | + defaultValue: false | |
| 42924 | + } | |
| 42925 | +]) | |
| 42926 | + | |
| 42927 | +module.exports = { | |
| 42928 | + ProgressEvent | |
| 42929 | +} | |
| 42930 | + | |
| 42931 | + | |
| 42932 | +/***/ }), | |
| 42933 | + | |
| 42934 | +/***/ 6812: | |
| 42935 | +/***/ ((module) => { | |
| 42936 | + | |
| 42937 | +"use strict"; | |
| 42938 | + | |
| 42939 | + | |
| 42940 | +module.exports = { | |
| 42941 | + kState: Symbol('FileReader state'), | |
| 42942 | + kResult: Symbol('FileReader result'), | |
| 42943 | + kError: Symbol('FileReader error'), | |
| 42944 | + kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), | |
| 42945 | + kEvents: Symbol('FileReader events'), | |
| 42946 | + kAborted: Symbol('FileReader aborted') | |
| 42947 | +} | |
| 42948 | + | |
| 42949 | + | |
| 42950 | +/***/ }), | |
| 42951 | + | |
| 42952 | +/***/ 165: | |
| 42953 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 42954 | + | |
| 42955 | +"use strict"; | |
| 42956 | + | |
| 42957 | + | |
| 42958 | +const { | |
| 42959 | + kState, | |
| 42960 | + kError, | |
| 42961 | + kResult, | |
| 42962 | + kAborted, | |
| 42963 | + kLastProgressEventFired | |
| 42964 | +} = __nccwpck_require__(6812) | |
| 42965 | +const { ProgressEvent } = __nccwpck_require__(5976) | |
| 42966 | +const { getEncoding } = __nccwpck_require__(396) | |
| 42967 | +const { DOMException } = __nccwpck_require__(7326) | |
| 42968 | +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4322) | |
| 42969 | +const { types } = __nccwpck_require__(9023) | |
| 42970 | +const { StringDecoder } = __nccwpck_require__(3193) | |
| 42971 | +const { btoa } = __nccwpck_require__(181) | |
| 42972 | + | |
| 42973 | +/** @type {PropertyDescriptor} */ | |
| 42974 | +const staticPropertyDescriptors = { | |
| 42975 | + enumerable: true, | |
| 42976 | + writable: false, | |
| 42977 | + configurable: false | |
| 42978 | +} | |
| 42979 | + | |
| 42980 | +/** | |
| 42981 | + * @see https://w3c.github.io/FileAPI/#readOperation | |
| 42982 | + * @param {import('./filereader').FileReader} fr | |
| 42983 | + * @param {import('buffer').Blob} blob | |
| 42984 | + * @param {string} type | |
| 42985 | + * @param {string?} encodingName | |
| 42986 | + */ | |
| 42987 | +function readOperation (fr, blob, type, encodingName) { | |
| 42988 | + // 1. If fr’s state is "loading", throw an InvalidStateError | |
| 42989 | + // DOMException. | |
| 42990 | + if (fr[kState] === 'loading') { | |
| 42991 | + throw new DOMException('Invalid state', 'InvalidStateError') | |
| 42992 | + } | |
| 42993 | + | |
| 42994 | + // 2. Set fr’s state to "loading". | |
| 42995 | + fr[kState] = 'loading' | |
| 42996 | + | |
| 42997 | + // 3. Set fr’s result to null. | |
| 42998 | + fr[kResult] = null | |
| 42999 | + | |
| 43000 | + // 4. Set fr’s error to null. | |
| 43001 | + fr[kError] = null | |
| 43002 | + | |
| 43003 | + // 5. Let stream be the result of calling get stream on blob. | |
| 43004 | + /** @type {import('stream/web').ReadableStream} */ | |
| 43005 | + const stream = blob.stream() | |
| 43006 | + | |
| 43007 | + // 6. Let reader be the result of getting a reader from stream. | |
| 43008 | + const reader = stream.getReader() | |
| 43009 | + | |
| 43010 | + // 7. Let bytes be an empty byte sequence. | |
| 43011 | + /** @type {Uint8Array[]} */ | |
| 43012 | + const bytes = [] | |
| 43013 | + | |
| 43014 | + // 8. Let chunkPromise be the result of reading a chunk from | |
| 43015 | + // stream with reader. | |
| 43016 | + let chunkPromise = reader.read() | |
| 43017 | + | |
| 43018 | + // 9. Let isFirstChunk be true. | |
| 43019 | + let isFirstChunk = true | |
| 43020 | + | |
| 43021 | + // 10. In parallel, while true: | |
| 43022 | + // Note: "In parallel" just means non-blocking | |
| 43023 | + // Note 2: readOperation itself cannot be async as double | |
| 43024 | + // reading the body would then reject the promise, instead | |
| 43025 | + // of throwing an error. | |
| 43026 | + ;(async () => { | |
| 43027 | + while (!fr[kAborted]) { | |
| 43028 | + // 1. Wait for chunkPromise to be fulfilled or rejected. | |
| 43029 | + try { | |
| 43030 | + const { done, value } = await chunkPromise | |
| 43031 | + | |
| 43032 | + // 2. If chunkPromise is fulfilled, and isFirstChunk is | |
| 43033 | + // true, queue a task to fire a progress event called | |
| 43034 | + // loadstart at fr. | |
| 43035 | + if (isFirstChunk && !fr[kAborted]) { | |
| 43036 | + queueMicrotask(() => { | |
| 43037 | + fireAProgressEvent('loadstart', fr) | |
| 43038 | + }) | |
| 43039 | + } | |
| 43040 | + | |
| 43041 | + // 3. Set isFirstChunk to false. | |
| 43042 | + isFirstChunk = false | |
| 43043 | + | |
| 43044 | + // 4. If chunkPromise is fulfilled with an object whose | |
| 43045 | + // done property is false and whose value property is | |
| 43046 | + // a Uint8Array object, run these steps: | |
| 43047 | + if (!done && types.isUint8Array(value)) { | |
| 43048 | + // 1. Let bs be the byte sequence represented by the | |
| 43049 | + // Uint8Array object. | |
| 43050 | + | |
| 43051 | + // 2. Append bs to bytes. | |
| 43052 | + bytes.push(value) | |
| 43053 | + | |
| 43054 | + // 3. If roughly 50ms have passed since these steps | |
| 43055 | + // were last invoked, queue a task to fire a | |
| 43056 | + // progress event called progress at fr. | |
| 43057 | + if ( | |
| 43058 | + ( | |
| 43059 | + fr[kLastProgressEventFired] === undefined || | |
| 43060 | + Date.now() - fr[kLastProgressEventFired] >= 50 | |
| 43061 | + ) && | |
| 43062 | + !fr[kAborted] | |
| 43063 | + ) { | |
| 43064 | + fr[kLastProgressEventFired] = Date.now() | |
| 43065 | + queueMicrotask(() => { | |
| 43066 | + fireAProgressEvent('progress', fr) | |
| 43067 | + }) | |
| 43068 | + } | |
| 43069 | + | |
| 43070 | + // 4. Set chunkPromise to the result of reading a | |
| 43071 | + // chunk from stream with reader. | |
| 43072 | + chunkPromise = reader.read() | |
| 43073 | + } else if (done) { | |
| 43074 | + // 5. Otherwise, if chunkPromise is fulfilled with an | |
| 43075 | + // object whose done property is true, queue a task | |
| 43076 | + // to run the following steps and abort this algorithm: | |
| 43077 | + queueMicrotask(() => { | |
| 43078 | + // 1. Set fr’s state to "done". | |
| 43079 | + fr[kState] = 'done' | |
| 43080 | + | |
| 43081 | + // 2. Let result be the result of package data given | |
| 43082 | + // bytes, type, blob’s type, and encodingName. | |
| 43083 | + try { | |
| 43084 | + const result = packageData(bytes, type, blob.type, encodingName) | |
| 43085 | + | |
| 43086 | + // 4. Else: | |
| 43087 | + | |
| 43088 | + if (fr[kAborted]) { | |
| 43089 | + return | |
| 43090 | + } | |
| 43091 | + | |
| 43092 | + // 1. Set fr’s result to result. | |
| 43093 | + fr[kResult] = result | |
| 43094 | + | |
| 43095 | + // 2. Fire a progress event called load at the fr. | |
| 43096 | + fireAProgressEvent('load', fr) | |
| 43097 | + } catch (error) { | |
| 43098 | + // 3. If package data threw an exception error: | |
| 43099 | + | |
| 43100 | + // 1. Set fr’s error to error. | |
| 43101 | + fr[kError] = error | |
| 43102 | + | |
| 43103 | + // 2. Fire a progress event called error at fr. | |
| 43104 | + fireAProgressEvent('error', fr) | |
| 43105 | + } | |
| 43106 | + | |
| 43107 | + // 5. If fr’s state is not "loading", fire a progress | |
| 43108 | + // event called loadend at the fr. | |
| 43109 | + if (fr[kState] !== 'loading') { | |
| 43110 | + fireAProgressEvent('loadend', fr) | |
| 43111 | + } | |
| 43112 | + }) | |
| 43113 | + | |
| 43114 | + break | |
| 43115 | + } | |
| 43116 | + } catch (error) { | |
| 43117 | + if (fr[kAborted]) { | |
| 43118 | + return | |
| 43119 | + } | |
| 43120 | + | |
| 43121 | + // 6. Otherwise, if chunkPromise is rejected with an | |
| 43122 | + // error error, queue a task to run the following | |
| 43123 | + // steps and abort this algorithm: | |
| 43124 | + queueMicrotask(() => { | |
| 43125 | + // 1. Set fr’s state to "done". | |
| 43126 | + fr[kState] = 'done' | |
| 43127 | + | |
| 43128 | + // 2. Set fr’s error to error. | |
| 43129 | + fr[kError] = error | |
| 43130 | + | |
| 43131 | + // 3. Fire a progress event called error at fr. | |
| 43132 | + fireAProgressEvent('error', fr) | |
| 43133 | + | |
| 43134 | + // 4. If fr’s state is not "loading", fire a progress | |
| 43135 | + // event called loadend at fr. | |
| 43136 | + if (fr[kState] !== 'loading') { | |
| 43137 | + fireAProgressEvent('loadend', fr) | |
| 43138 | + } | |
| 43139 | + }) | |
| 43140 | + | |
| 43141 | + break | |
| 43142 | + } | |
| 43143 | + } | |
| 43144 | + })() | |
| 43145 | +} | |
| 43146 | + | |
| 43147 | +/** | |
| 43148 | + * @see https://w3c.github.io/FileAPI/#fire-a-progress-event | |
| 43149 | + * @see https://dom.spec.whatwg.org/#concept-event-fire | |
| 43150 | + * @param {string} e The name of the event | |
| 43151 | + * @param {import('./filereader').FileReader} reader | |
| 43152 | + */ | |
| 43153 | +function fireAProgressEvent (e, reader) { | |
| 43154 | + // The progress event e does not bubble. e.bubbles must be false | |
| 43155 | + // The progress event e is NOT cancelable. e.cancelable must be false | |
| 43156 | + const event = new ProgressEvent(e, { | |
| 43157 | + bubbles: false, | |
| 43158 | + cancelable: false | |
| 43159 | + }) | |
| 43160 | + | |
| 43161 | + reader.dispatchEvent(event) | |
| 43162 | +} | |
| 43163 | + | |
| 43164 | +/** | |
| 43165 | + * @see https://w3c.github.io/FileAPI/#blob-package-data | |
| 43166 | + * @param {Uint8Array[]} bytes | |
| 43167 | + * @param {string} type | |
| 43168 | + * @param {string?} mimeType | |
| 43169 | + * @param {string?} encodingName | |
| 43170 | + */ | |
| 43171 | +function packageData (bytes, type, mimeType, encodingName) { | |
| 43172 | + // 1. A Blob has an associated package data algorithm, given | |
| 43173 | + // bytes, a type, a optional mimeType, and a optional | |
| 43174 | + // encodingName, which switches on type and runs the | |
| 43175 | + // associated steps: | |
| 43176 | + | |
| 43177 | + switch (type) { | |
| 43178 | + case 'DataURL': { | |
| 43179 | + // 1. Return bytes as a DataURL [RFC2397] subject to | |
| 43180 | + // the considerations below: | |
| 43181 | + // * Use mimeType as part of the Data URL if it is | |
| 43182 | + // available in keeping with the Data URL | |
| 43183 | + // specification [RFC2397]. | |
| 43184 | + // * If mimeType is not available return a Data URL | |
| 43185 | + // without a media-type. [RFC2397]. | |
| 43186 | + | |
| 43187 | + // https://datatracker.ietf.org/doc/html/rfc2397#section-3 | |
| 43188 | + // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data | |
| 43189 | + // mediatype := [ type "/" subtype ] *( ";" parameter ) | |
| 43190 | + // data := *urlchar | |
| 43191 | + // parameter := attribute "=" value | |
| 43192 | + let dataURL = 'data:' | |
| 43193 | + | |
| 43194 | + const parsed = parseMIMEType(mimeType || 'application/octet-stream') | |
| 43195 | + | |
| 43196 | + if (parsed !== 'failure') { | |
| 43197 | + dataURL += serializeAMimeType(parsed) | |
| 43198 | + } | |
| 43199 | + | |
| 43200 | + dataURL += ';base64,' | |
| 43201 | + | |
| 43202 | + const decoder = new StringDecoder('latin1') | |
| 43203 | + | |
| 43204 | + for (const chunk of bytes) { | |
| 43205 | + dataURL += btoa(decoder.write(chunk)) | |
| 43206 | + } | |
| 43207 | + | |
| 43208 | + dataURL += btoa(decoder.end()) | |
| 43209 | + | |
| 43210 | + return dataURL | |
| 43211 | + } | |
| 43212 | + case 'Text': { | |
| 43213 | + // 1. Let encoding be failure | |
| 43214 | + let encoding = 'failure' | |
| 43215 | + | |
| 43216 | + // 2. If the encodingName is present, set encoding to the | |
| 43217 | + // result of getting an encoding from encodingName. | |
| 43218 | + if (encodingName) { | |
| 43219 | + encoding = getEncoding(encodingName) | |
| 43220 | + } | |
| 43221 | + | |
| 43222 | + // 3. If encoding is failure, and mimeType is present: | |
| 43223 | + if (encoding === 'failure' && mimeType) { | |
| 43224 | + // 1. Let type be the result of parse a MIME type | |
| 43225 | + // given mimeType. | |
| 43226 | + const type = parseMIMEType(mimeType) | |
| 43227 | + | |
| 43228 | + // 2. If type is not failure, set encoding to the result | |
| 43229 | + // of getting an encoding from type’s parameters["charset"]. | |
| 43230 | + if (type !== 'failure') { | |
| 43231 | + encoding = getEncoding(type.parameters.get('charset')) | |
| 43232 | + } | |
| 43233 | + } | |
| 43234 | + | |
| 43235 | + // 4. If encoding is failure, then set encoding to UTF-8. | |
| 43236 | + if (encoding === 'failure') { | |
| 43237 | + encoding = 'UTF-8' | |
| 43238 | + } | |
| 43239 | + | |
| 43240 | + // 5. Decode bytes using fallback encoding encoding, and | |
| 43241 | + // return the result. | |
| 43242 | + return decode(bytes, encoding) | |
| 43243 | + } | |
| 43244 | + case 'ArrayBuffer': { | |
| 43245 | + // Return a new ArrayBuffer whose contents are bytes. | |
| 43246 | + const sequence = combineByteSequences(bytes) | |
| 43247 | + | |
| 43248 | + return sequence.buffer | |
| 43249 | + } | |
| 43250 | + case 'BinaryString': { | |
| 43251 | + // Return bytes as a binary string, in which every byte | |
| 43252 | + // is represented by a code unit of equal value [0..255]. | |
| 43253 | + let binaryString = '' | |
| 43254 | + | |
| 43255 | + const decoder = new StringDecoder('latin1') | |
| 43256 | + | |
| 43257 | + for (const chunk of bytes) { | |
| 43258 | + binaryString += decoder.write(chunk) | |
| 43259 | + } | |
| 43260 | + | |
| 43261 | + binaryString += decoder.end() | |
| 43262 | + | |
| 43263 | + return binaryString | |
| 43264 | + } | |
| 43265 | + } | |
| 43266 | +} | |
| 43267 | + | |
| 43268 | +/** | |
| 43269 | + * @see https://encoding.spec.whatwg.org/#decode | |
| 43270 | + * @param {Uint8Array[]} ioQueue | |
| 43271 | + * @param {string} encoding | |
| 43272 | + */ | |
| 43273 | +function decode (ioQueue, encoding) { | |
| 43274 | + const bytes = combineByteSequences(ioQueue) | |
| 43275 | + | |
| 43276 | + // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. | |
| 43277 | + const BOMEncoding = BOMSniffing(bytes) | |
| 43278 | + | |
| 43279 | + let slice = 0 | |
| 43280 | + | |
| 43281 | + // 2. If BOMEncoding is non-null: | |
| 43282 | + if (BOMEncoding !== null) { | |
| 43283 | + // 1. Set encoding to BOMEncoding. | |
| 43284 | + encoding = BOMEncoding | |
| 43285 | + | |
| 43286 | + // 2. Read three bytes from ioQueue, if BOMEncoding is | |
| 43287 | + // UTF-8; otherwise read two bytes. | |
| 43288 | + // (Do nothing with those bytes.) | |
| 43289 | + slice = BOMEncoding === 'UTF-8' ? 3 : 2 | |
| 43290 | + } | |
| 43291 | + | |
| 43292 | + // 3. Process a queue with an instance of encoding’s | |
| 43293 | + // decoder, ioQueue, output, and "replacement". | |
| 43294 | + | |
| 43295 | + // 4. Return output. | |
| 43296 | + | |
| 43297 | + const sliced = bytes.slice(slice) | |
| 43298 | + return new TextDecoder(encoding).decode(sliced) | |
| 43299 | +} | |
| 43300 | + | |
| 43301 | +/** | |
| 43302 | + * @see https://encoding.spec.whatwg.org/#bom-sniff | |
| 43303 | + * @param {Uint8Array} ioQueue | |
| 43304 | + */ | |
| 43305 | +function BOMSniffing (ioQueue) { | |
| 43306 | + // 1. Let BOM be the result of peeking 3 bytes from ioQueue, | |
| 43307 | + // converted to a byte sequence. | |
| 43308 | + const [a, b, c] = ioQueue | |
| 43309 | + | |
| 43310 | + // 2. For each of the rows in the table below, starting with | |
| 43311 | + // the first one and going down, if BOM starts with the | |
| 43312 | + // bytes given in the first column, then return the | |
| 43313 | + // encoding given in the cell in the second column of that | |
| 43314 | + // row. Otherwise, return null. | |
| 43315 | + if (a === 0xEF && b === 0xBB && c === 0xBF) { | |
| 43316 | + return 'UTF-8' | |
| 43317 | + } else if (a === 0xFE && b === 0xFF) { | |
| 43318 | + return 'UTF-16BE' | |
| 43319 | + } else if (a === 0xFF && b === 0xFE) { | |
| 43320 | + return 'UTF-16LE' | |
| 43321 | + } | |
| 43322 | + | |
| 43323 | + return null | |
| 43324 | +} | |
| 43325 | + | |
| 43326 | +/** | |
| 43327 | + * @param {Uint8Array[]} sequences | |
| 43328 | + */ | |
| 43329 | +function combineByteSequences (sequences) { | |
| 43330 | + const size = sequences.reduce((a, b) => { | |
| 43331 | + return a + b.byteLength | |
| 43332 | + }, 0) | |
| 43333 | + | |
| 43334 | + let offset = 0 | |
| 43335 | + | |
| 43336 | + return sequences.reduce((a, b) => { | |
| 43337 | + a.set(b, offset) | |
| 43338 | + offset += b.byteLength | |
| 43339 | + return a | |
| 43340 | + }, new Uint8Array(size)) | |
| 43341 | +} | |
| 43342 | + | |
| 43343 | +module.exports = { | |
| 43344 | + staticPropertyDescriptors, | |
| 43345 | + readOperation, | |
| 43346 | + fireAProgressEvent | |
| 43347 | +} | |
| 43348 | + | |
| 43349 | + | |
| 43350 | +/***/ }), | |
| 43351 | + | |
| 43352 | +/***/ 2581: | |
| 43353 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 43354 | + | |
| 43355 | +"use strict"; | |
| 43356 | + | |
| 43357 | + | |
| 43358 | +// We include a version number for the Dispatcher API. In case of breaking changes, | |
| 43359 | +// this version number must be increased to avoid conflicts. | |
| 43360 | +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') | |
| 43361 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 43362 | +const Agent = __nccwpck_require__(9965) | |
| 43363 | + | |
| 43364 | +if (getGlobalDispatcher() === undefined) { | |
| 43365 | + setGlobalDispatcher(new Agent()) | |
| 43366 | +} | |
| 43367 | + | |
| 43368 | +function setGlobalDispatcher (agent) { | |
| 43369 | + if (!agent || typeof agent.dispatch !== 'function') { | |
| 43370 | + throw new InvalidArgumentError('Argument agent must implement Agent') | |
| 43371 | + } | |
| 43372 | + Object.defineProperty(globalThis, globalDispatcher, { | |
| 43373 | + value: agent, | |
| 43374 | + writable: true, | |
| 43375 | + enumerable: false, | |
| 43376 | + configurable: false | |
| 43377 | + }) | |
| 43378 | +} | |
| 43379 | + | |
| 43380 | +function getGlobalDispatcher () { | |
| 43381 | + return globalThis[globalDispatcher] | |
| 43382 | +} | |
| 43383 | + | |
| 43384 | +module.exports = { | |
| 43385 | + setGlobalDispatcher, | |
| 43386 | + getGlobalDispatcher | |
| 43387 | +} | |
| 43388 | + | |
| 43389 | + | |
| 43390 | +/***/ }), | |
| 43391 | + | |
| 43392 | +/***/ 8840: | |
| 43393 | +/***/ ((module) => { | |
| 43394 | + | |
| 43395 | +"use strict"; | |
| 43396 | + | |
| 43397 | + | |
| 43398 | +module.exports = class DecoratorHandler { | |
| 43399 | + constructor (handler) { | |
| 43400 | + this.handler = handler | |
| 43401 | + } | |
| 43402 | + | |
| 43403 | + onConnect (...args) { | |
| 43404 | + return this.handler.onConnect(...args) | |
| 43405 | + } | |
| 43406 | + | |
| 43407 | + onError (...args) { | |
| 43408 | + return this.handler.onError(...args) | |
| 43409 | + } | |
| 43410 | + | |
| 43411 | + onUpgrade (...args) { | |
| 43412 | + return this.handler.onUpgrade(...args) | |
| 43413 | + } | |
| 43414 | + | |
| 43415 | + onHeaders (...args) { | |
| 43416 | + return this.handler.onHeaders(...args) | |
| 43417 | + } | |
| 43418 | + | |
| 43419 | + onData (...args) { | |
| 43420 | + return this.handler.onData(...args) | |
| 43421 | + } | |
| 43422 | + | |
| 43423 | + onComplete (...args) { | |
| 43424 | + return this.handler.onComplete(...args) | |
| 43425 | + } | |
| 43426 | + | |
| 43427 | + onBodySent (...args) { | |
| 43428 | + return this.handler.onBodySent(...args) | |
| 43429 | + } | |
| 43430 | +} | |
| 43431 | + | |
| 43432 | + | |
| 43433 | +/***/ }), | |
| 43434 | + | |
| 43435 | +/***/ 8299: | |
| 43436 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 43437 | + | |
| 43438 | +"use strict"; | |
| 43439 | + | |
| 43440 | + | |
| 43441 | +const util = __nccwpck_require__(3440) | |
| 43442 | +const { kBodyUsed } = __nccwpck_require__(6443) | |
| 43443 | +const assert = __nccwpck_require__(2613) | |
| 43444 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 43445 | +const EE = __nccwpck_require__(4434) | |
| 43446 | + | |
| 43447 | +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] | |
| 43448 | + | |
| 43449 | +const kBody = Symbol('body') | |
| 43450 | + | |
| 43451 | +class BodyAsyncIterable { | |
| 43452 | + constructor (body) { | |
| 43453 | + this[kBody] = body | |
| 43454 | + this[kBodyUsed] = false | |
| 43455 | + } | |
| 43456 | + | |
| 43457 | + async * [Symbol.asyncIterator] () { | |
| 43458 | + assert(!this[kBodyUsed], 'disturbed') | |
| 43459 | + this[kBodyUsed] = true | |
| 43460 | + yield * this[kBody] | |
| 43461 | + } | |
| 43462 | +} | |
| 43463 | + | |
| 43464 | +class RedirectHandler { | |
| 43465 | + constructor (dispatch, maxRedirections, opts, handler) { | |
| 43466 | + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { | |
| 43467 | + throw new InvalidArgumentError('maxRedirections must be a positive number') | |
| 43468 | + } | |
| 43469 | + | |
| 43470 | + util.validateHandler(handler, opts.method, opts.upgrade) | |
| 43471 | + | |
| 43472 | + this.dispatch = dispatch | |
| 43473 | + this.location = null | |
| 43474 | + this.abort = null | |
| 43475 | + this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy | |
| 43476 | + this.maxRedirections = maxRedirections | |
| 43477 | + this.handler = handler | |
| 43478 | + this.history = [] | |
| 43479 | + | |
| 43480 | + if (util.isStream(this.opts.body)) { | |
| 43481 | + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp | |
| 43482 | + // so that it can be dispatched again? | |
| 43483 | + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? | |
| 43484 | + if (util.bodyLength(this.opts.body) === 0) { | |
| 43485 | + this.opts.body | |
| 43486 | + .on('data', function () { | |
| 43487 | + assert(false) | |
| 43488 | + }) | |
| 43489 | + } | |
| 43490 | + | |
| 43491 | + if (typeof this.opts.body.readableDidRead !== 'boolean') { | |
| 43492 | + this.opts.body[kBodyUsed] = false | |
| 43493 | + EE.prototype.on.call(this.opts.body, 'data', function () { | |
| 43494 | + this[kBodyUsed] = true | |
| 43495 | + }) | |
| 43496 | + } | |
| 43497 | + } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { | |
| 43498 | + // TODO (fix): We can't access ReadableStream internal state | |
| 43499 | + // to determine whether or not it has been disturbed. This is just | |
| 43500 | + // a workaround. | |
| 43501 | + this.opts.body = new BodyAsyncIterable(this.opts.body) | |
| 43502 | + } else if ( | |
| 43503 | + this.opts.body && | |
| 43504 | + typeof this.opts.body !== 'string' && | |
| 43505 | + !ArrayBuffer.isView(this.opts.body) && | |
| 43506 | + util.isIterable(this.opts.body) | |
| 43507 | + ) { | |
| 43508 | + // TODO: Should we allow re-using iterable if !this.opts.idempotent | |
| 43509 | + // or through some other flag? | |
| 43510 | + this.opts.body = new BodyAsyncIterable(this.opts.body) | |
| 43511 | + } | |
| 43512 | + } | |
| 43513 | + | |
| 43514 | + onConnect (abort) { | |
| 43515 | + this.abort = abort | |
| 43516 | + this.handler.onConnect(abort, { history: this.history }) | |
| 43517 | + } | |
| 43518 | + | |
| 43519 | + onUpgrade (statusCode, headers, socket) { | |
| 43520 | + this.handler.onUpgrade(statusCode, headers, socket) | |
| 43521 | + } | |
| 43522 | + | |
| 43523 | + onError (error) { | |
| 43524 | + this.handler.onError(error) | |
| 43525 | + } | |
| 43526 | + | |
| 43527 | + onHeaders (statusCode, headers, resume, statusText) { | |
| 43528 | + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) | |
| 43529 | + ? null | |
| 43530 | + : parseLocation(statusCode, headers) | |
| 43531 | + | |
| 43532 | + if (this.opts.origin) { | |
| 43533 | + this.history.push(new URL(this.opts.path, this.opts.origin)) | |
| 43534 | + } | |
| 43535 | + | |
| 43536 | + if (!this.location) { | |
| 43537 | + return this.handler.onHeaders(statusCode, headers, resume, statusText) | |
| 43538 | + } | |
| 43539 | + | |
| 43540 | + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) | |
| 43541 | + const path = search ? `${pathname}${search}` : pathname | |
| 43542 | + | |
| 43543 | + // Remove headers referring to the original URL. | |
| 43544 | + // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. | |
| 43545 | + // https://tools.ietf.org/html/rfc7231#section-6.4 | |
| 43546 | + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) | |
| 43547 | + this.opts.path = path | |
| 43548 | + this.opts.origin = origin | |
| 43549 | + this.opts.maxRedirections = 0 | |
| 43550 | + this.opts.query = null | |
| 43551 | + | |
| 43552 | + // https://tools.ietf.org/html/rfc7231#section-6.4.4 | |
| 43553 | + // In case of HTTP 303, always replace method to be either HEAD or GET | |
| 43554 | + if (statusCode === 303 && this.opts.method !== 'HEAD') { | |
| 43555 | + this.opts.method = 'GET' | |
| 43556 | + this.opts.body = null | |
| 43557 | + } | |
| 43558 | + } | |
| 43559 | + | |
| 43560 | + onData (chunk) { | |
| 43561 | + if (this.location) { | |
| 43562 | + /* | |
| 43563 | + https://tools.ietf.org/html/rfc7231#section-6.4 | |
| 43564 | + | |
| 43565 | + TLDR: undici always ignores 3xx response bodies. | |
| 43566 | + | |
| 43567 | + Redirection is used to serve the requested resource from another URL, so it is assumes that | |
| 43568 | + no body is generated (and thus can be ignored). Even though generating a body is not prohibited. | |
| 43569 | + | |
| 43570 | + For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually | |
| 43571 | + (which means it's optional and not mandated) contain just an hyperlink to the value of | |
| 43572 | + the Location response header, so the body can be ignored safely. | |
| 43573 | + | |
| 43574 | + For status 300, which is "Multiple Choices", the spec mentions both generating a Location | |
| 43575 | + response header AND a response body with the other possible location to follow. | |
| 43576 | + Since the spec explicitily chooses not to specify a format for such body and leave it to | |
| 43577 | + servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. | |
| 43578 | + */ | |
| 43579 | + } else { | |
| 43580 | + return this.handler.onData(chunk) | |
| 43581 | + } | |
| 43582 | + } | |
| 43583 | + | |
| 43584 | + onComplete (trailers) { | |
| 43585 | + if (this.location) { | |
| 43586 | + /* | |
| 43587 | + https://tools.ietf.org/html/rfc7231#section-6.4 | |
| 43588 | + | |
| 43589 | + TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections | |
| 43590 | + and neither are useful if present. | |
| 43591 | + | |
| 43592 | + See comment on onData method above for more detailed informations. | |
| 43593 | + */ | |
| 43594 | + | |
| 43595 | + this.location = null | |
| 43596 | + this.abort = null | |
| 43597 | + | |
| 43598 | + this.dispatch(this.opts, this) | |
| 43599 | + } else { | |
| 43600 | + this.handler.onComplete(trailers) | |
| 43601 | + } | |
| 43602 | + } | |
| 43603 | + | |
| 43604 | + onBodySent (chunk) { | |
| 43605 | + if (this.handler.onBodySent) { | |
| 43606 | + this.handler.onBodySent(chunk) | |
| 43607 | + } | |
| 43608 | + } | |
| 43609 | +} | |
| 43610 | + | |
| 43611 | +function parseLocation (statusCode, headers) { | |
| 43612 | + if (redirectableStatusCodes.indexOf(statusCode) === -1) { | |
| 43613 | + return null | |
| 43614 | + } | |
| 43615 | + | |
| 43616 | + for (let i = 0; i < headers.length; i += 2) { | |
| 43617 | + if (headers[i].toString().toLowerCase() === 'location') { | |
| 43618 | + return headers[i + 1] | |
| 43619 | + } | |
| 43620 | + } | |
| 43621 | +} | |
| 43622 | + | |
| 43623 | +// https://tools.ietf.org/html/rfc7231#section-6.4.4 | |
| 43624 | +function shouldRemoveHeader (header, removeContent, unknownOrigin) { | |
| 43625 | + if (header.length === 4) { | |
| 43626 | + return util.headerNameToString(header) === 'host' | |
| 43627 | + } | |
| 43628 | + if (removeContent && util.headerNameToString(header).startsWith('content-')) { | |
| 43629 | + return true | |
| 43630 | + } | |
| 43631 | + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { | |
| 43632 | + const name = util.headerNameToString(header) | |
| 43633 | + return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization' | |
| 43634 | + } | |
| 43635 | + return false | |
| 43636 | +} | |
| 43637 | + | |
| 43638 | +// https://tools.ietf.org/html/rfc7231#section-6.4 | |
| 43639 | +function cleanRequestHeaders (headers, removeContent, unknownOrigin) { | |
| 43640 | + const ret = [] | |
| 43641 | + if (Array.isArray(headers)) { | |
| 43642 | + for (let i = 0; i < headers.length; i += 2) { | |
| 43643 | + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { | |
| 43644 | + ret.push(headers[i], headers[i + 1]) | |
| 43645 | + } | |
| 43646 | + } | |
| 43647 | + } else if (headers && typeof headers === 'object') { | |
| 43648 | + for (const key of Object.keys(headers)) { | |
| 43649 | + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { | |
| 43650 | + ret.push(key, headers[key]) | |
| 43651 | + } | |
| 43652 | + } | |
| 43653 | + } else { | |
| 43654 | + assert(headers == null, 'headers must be an object or an array') | |
| 43655 | + } | |
| 43656 | + return ret | |
| 43657 | +} | |
| 43658 | + | |
| 43659 | +module.exports = RedirectHandler | |
| 43660 | + | |
| 43661 | + | |
| 43662 | +/***/ }), | |
| 43663 | + | |
| 43664 | +/***/ 3573: | |
| 43665 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 43666 | + | |
| 43667 | +const assert = __nccwpck_require__(2613) | |
| 43668 | + | |
| 43669 | +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(6443) | |
| 43670 | +const { RequestRetryError } = __nccwpck_require__(8707) | |
| 43671 | +const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3440) | |
| 43672 | + | |
| 43673 | +function calculateRetryAfterHeader (retryAfter) { | |
| 43674 | + const current = Date.now() | |
| 43675 | + const diff = new Date(retryAfter).getTime() - current | |
| 43676 | + | |
| 43677 | + return diff | |
| 43678 | +} | |
| 43679 | + | |
| 43680 | +class RetryHandler { | |
| 43681 | + constructor (opts, handlers) { | |
| 43682 | + const { retryOptions, ...dispatchOpts } = opts | |
| 43683 | + const { | |
| 43684 | + // Retry scoped | |
| 43685 | + retry: retryFn, | |
| 43686 | + maxRetries, | |
| 43687 | + maxTimeout, | |
| 43688 | + minTimeout, | |
| 43689 | + timeoutFactor, | |
| 43690 | + // Response scoped | |
| 43691 | + methods, | |
| 43692 | + errorCodes, | |
| 43693 | + retryAfter, | |
| 43694 | + statusCodes | |
| 43695 | + } = retryOptions ?? {} | |
| 43696 | + | |
| 43697 | + this.dispatch = handlers.dispatch | |
| 43698 | + this.handler = handlers.handler | |
| 43699 | + this.opts = dispatchOpts | |
| 43700 | + this.abort = null | |
| 43701 | + this.aborted = false | |
| 43702 | + this.retryOpts = { | |
| 43703 | + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], | |
| 43704 | + retryAfter: retryAfter ?? true, | |
| 43705 | + maxTimeout: maxTimeout ?? 30 * 1000, // 30s, | |
| 43706 | + timeout: minTimeout ?? 500, // .5s | |
| 43707 | + timeoutFactor: timeoutFactor ?? 2, | |
| 43708 | + maxRetries: maxRetries ?? 5, | |
| 43709 | + // What errors we should retry | |
| 43710 | + methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], | |
| 43711 | + // Indicates which errors to retry | |
| 43712 | + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], | |
| 43713 | + // List of errors to retry | |
| 43714 | + errorCodes: errorCodes ?? [ | |
| 43715 | + 'ECONNRESET', | |
| 43716 | + 'ECONNREFUSED', | |
| 43717 | + 'ENOTFOUND', | |
| 43718 | + 'ENETDOWN', | |
| 43719 | + 'ENETUNREACH', | |
| 43720 | + 'EHOSTDOWN', | |
| 43721 | + 'EHOSTUNREACH', | |
| 43722 | + 'EPIPE' | |
| 43723 | + ] | |
| 43724 | + } | |
| 43725 | + | |
| 43726 | + this.retryCount = 0 | |
| 43727 | + this.start = 0 | |
| 43728 | + this.end = null | |
| 43729 | + this.etag = null | |
| 43730 | + this.resume = null | |
| 43731 | + | |
| 43732 | + // Handle possible onConnect duplication | |
| 43733 | + this.handler.onConnect(reason => { | |
| 43734 | + this.aborted = true | |
| 43735 | + if (this.abort) { | |
| 43736 | + this.abort(reason) | |
| 43737 | + } else { | |
| 43738 | + this.reason = reason | |
| 43739 | + } | |
| 43740 | + }) | |
| 43741 | + } | |
| 43742 | + | |
| 43743 | + onRequestSent () { | |
| 43744 | + if (this.handler.onRequestSent) { | |
| 43745 | + this.handler.onRequestSent() | |
| 43746 | + } | |
| 43747 | + } | |
| 43748 | + | |
| 43749 | + onUpgrade (statusCode, headers, socket) { | |
| 43750 | + if (this.handler.onUpgrade) { | |
| 43751 | + this.handler.onUpgrade(statusCode, headers, socket) | |
| 43752 | + } | |
| 43753 | + } | |
| 43754 | + | |
| 43755 | + onConnect (abort) { | |
| 43756 | + if (this.aborted) { | |
| 43757 | + abort(this.reason) | |
| 43758 | + } else { | |
| 43759 | + this.abort = abort | |
| 43760 | + } | |
| 43761 | + } | |
| 43762 | + | |
| 43763 | + onBodySent (chunk) { | |
| 43764 | + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) | |
| 43765 | + } | |
| 43766 | + | |
| 43767 | + static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { | |
| 43768 | + const { statusCode, code, headers } = err | |
| 43769 | + const { method, retryOptions } = opts | |
| 43770 | + const { | |
| 43771 | + maxRetries, | |
| 43772 | + timeout, | |
| 43773 | + maxTimeout, | |
| 43774 | + timeoutFactor, | |
| 43775 | + statusCodes, | |
| 43776 | + errorCodes, | |
| 43777 | + methods | |
| 43778 | + } = retryOptions | |
| 43779 | + let { counter, currentTimeout } = state | |
| 43780 | + | |
| 43781 | + currentTimeout = | |
| 43782 | + currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout | |
| 43783 | + | |
| 43784 | + // Any code that is not a Undici's originated and allowed to retry | |
| 43785 | + if ( | |
| 43786 | + code && | |
| 43787 | + code !== 'UND_ERR_REQ_RETRY' && | |
| 43788 | + code !== 'UND_ERR_SOCKET' && | |
| 43789 | + !errorCodes.includes(code) | |
| 43790 | + ) { | |
| 43791 | + cb(err) | |
| 43792 | + return | |
| 43793 | + } | |
| 43794 | + | |
| 43795 | + // If a set of method are provided and the current method is not in the list | |
| 43796 | + if (Array.isArray(methods) && !methods.includes(method)) { | |
| 43797 | + cb(err) | |
| 43798 | + return | |
| 43799 | + } | |
| 43800 | + | |
| 43801 | + // If a set of status code are provided and the current status code is not in the list | |
| 43802 | + if ( | |
| 43803 | + statusCode != null && | |
| 43804 | + Array.isArray(statusCodes) && | |
| 43805 | + !statusCodes.includes(statusCode) | |
| 43806 | + ) { | |
| 43807 | + cb(err) | |
| 43808 | + return | |
| 43809 | + } | |
| 43810 | + | |
| 43811 | + // If we reached the max number of retries | |
| 43812 | + if (counter > maxRetries) { | |
| 43813 | + cb(err) | |
| 43814 | + return | |
| 43815 | + } | |
| 43816 | + | |
| 43817 | + let retryAfterHeader = headers != null && headers['retry-after'] | |
| 43818 | + if (retryAfterHeader) { | |
| 43819 | + retryAfterHeader = Number(retryAfterHeader) | |
| 43820 | + retryAfterHeader = isNaN(retryAfterHeader) | |
| 43821 | + ? calculateRetryAfterHeader(retryAfterHeader) | |
| 43822 | + : retryAfterHeader * 1e3 // Retry-After is in seconds | |
| 43823 | + } | |
| 43824 | + | |
| 43825 | + const retryTimeout = | |
| 43826 | + retryAfterHeader > 0 | |
| 43827 | + ? Math.min(retryAfterHeader, maxTimeout) | |
| 43828 | + : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) | |
| 43829 | + | |
| 43830 | + state.currentTimeout = retryTimeout | |
| 43831 | + | |
| 43832 | + setTimeout(() => cb(null), retryTimeout) | |
| 43833 | + } | |
| 43834 | + | |
| 43835 | + onHeaders (statusCode, rawHeaders, resume, statusMessage) { | |
| 43836 | + const headers = parseHeaders(rawHeaders) | |
| 43837 | + | |
| 43838 | + this.retryCount += 1 | |
| 43839 | + | |
| 43840 | + if (statusCode >= 300) { | |
| 43841 | + this.abort( | |
| 43842 | + new RequestRetryError('Request failed', statusCode, { | |
| 43843 | + headers, | |
| 43844 | + count: this.retryCount | |
| 43845 | + }) | |
| 43846 | + ) | |
| 43847 | + return false | |
| 43848 | + } | |
| 43849 | + | |
| 43850 | + // Checkpoint for resume from where we left it | |
| 43851 | + if (this.resume != null) { | |
| 43852 | + this.resume = null | |
| 43853 | + | |
| 43854 | + if (statusCode !== 206) { | |
| 43855 | + return true | |
| 43856 | + } | |
| 43857 | + | |
| 43858 | + const contentRange = parseRangeHeader(headers['content-range']) | |
| 43859 | + // If no content range | |
| 43860 | + if (!contentRange) { | |
| 43861 | + this.abort( | |
| 43862 | + new RequestRetryError('Content-Range mismatch', statusCode, { | |
| 43863 | + headers, | |
| 43864 | + count: this.retryCount | |
| 43865 | + }) | |
| 43866 | + ) | |
| 43867 | + return false | |
| 43868 | + } | |
| 43869 | + | |
| 43870 | + // Let's start with a weak etag check | |
| 43871 | + if (this.etag != null && this.etag !== headers.etag) { | |
| 43872 | + this.abort( | |
| 43873 | + new RequestRetryError('ETag mismatch', statusCode, { | |
| 43874 | + headers, | |
| 43875 | + count: this.retryCount | |
| 43876 | + }) | |
| 43877 | + ) | |
| 43878 | + return false | |
| 43879 | + } | |
| 43880 | + | |
| 43881 | + const { start, size, end = size } = contentRange | |
| 43882 | + | |
| 43883 | + assert(this.start === start, 'content-range mismatch') | |
| 43884 | + assert(this.end == null || this.end === end, 'content-range mismatch') | |
| 43885 | + | |
| 43886 | + this.resume = resume | |
| 43887 | + return true | |
| 43888 | + } | |
| 43889 | + | |
| 43890 | + if (this.end == null) { | |
| 43891 | + if (statusCode === 206) { | |
| 43892 | + // First time we receive 206 | |
| 43893 | + const range = parseRangeHeader(headers['content-range']) | |
| 43894 | + | |
| 43895 | + if (range == null) { | |
| 43896 | + return this.handler.onHeaders( | |
| 43897 | + statusCode, | |
| 43898 | + rawHeaders, | |
| 43899 | + resume, | |
| 43900 | + statusMessage | |
| 43901 | + ) | |
| 43902 | + } | |
| 43903 | + | |
| 43904 | + const { start, size, end = size } = range | |
| 43905 | + | |
| 43906 | + assert( | |
| 43907 | + start != null && Number.isFinite(start) && this.start !== start, | |
| 43908 | + 'content-range mismatch' | |
| 43909 | + ) | |
| 43910 | + assert(Number.isFinite(start)) | |
| 43911 | + assert( | |
| 43912 | + end != null && Number.isFinite(end) && this.end !== end, | |
| 43913 | + 'invalid content-length' | |
| 43914 | + ) | |
| 43915 | + | |
| 43916 | + this.start = start | |
| 43917 | + this.end = end | |
| 43918 | + } | |
| 43919 | + | |
| 43920 | + // We make our best to checkpoint the body for further range headers | |
| 43921 | + if (this.end == null) { | |
| 43922 | + const contentLength = headers['content-length'] | |
| 43923 | + this.end = contentLength != null ? Number(contentLength) : null | |
| 43924 | + } | |
| 43925 | + | |
| 43926 | + assert(Number.isFinite(this.start)) | |
| 43927 | + assert( | |
| 43928 | + this.end == null || Number.isFinite(this.end), | |
| 43929 | + 'invalid content-length' | |
| 43930 | + ) | |
| 43931 | + | |
| 43932 | + this.resume = resume | |
| 43933 | + this.etag = headers.etag != null ? headers.etag : null | |
| 43934 | + | |
| 43935 | + return this.handler.onHeaders( | |
| 43936 | + statusCode, | |
| 43937 | + rawHeaders, | |
| 43938 | + resume, | |
| 43939 | + statusMessage | |
| 43940 | + ) | |
| 43941 | + } | |
| 43942 | + | |
| 43943 | + const err = new RequestRetryError('Request failed', statusCode, { | |
| 43944 | + headers, | |
| 43945 | + count: this.retryCount | |
| 43946 | + }) | |
| 43947 | + | |
| 43948 | + this.abort(err) | |
| 43949 | + | |
| 43950 | + return false | |
| 43951 | + } | |
| 43952 | + | |
| 43953 | + onData (chunk) { | |
| 43954 | + this.start += chunk.length | |
| 43955 | + | |
| 43956 | + return this.handler.onData(chunk) | |
| 43957 | + } | |
| 43958 | + | |
| 43959 | + onComplete (rawTrailers) { | |
| 43960 | + this.retryCount = 0 | |
| 43961 | + return this.handler.onComplete(rawTrailers) | |
| 43962 | + } | |
| 43963 | + | |
| 43964 | + onError (err) { | |
| 43965 | + if (this.aborted || isDisturbed(this.opts.body)) { | |
| 43966 | + return this.handler.onError(err) | |
| 43967 | + } | |
| 43968 | + | |
| 43969 | + this.retryOpts.retry( | |
| 43970 | + err, | |
| 43971 | + { | |
| 43972 | + state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, | |
| 43973 | + opts: { retryOptions: this.retryOpts, ...this.opts } | |
| 43974 | + }, | |
| 43975 | + onRetry.bind(this) | |
| 43976 | + ) | |
| 43977 | + | |
| 43978 | + function onRetry (err) { | |
| 43979 | + if (err != null || this.aborted || isDisturbed(this.opts.body)) { | |
| 43980 | + return this.handler.onError(err) | |
| 43981 | + } | |
| 43982 | + | |
| 43983 | + if (this.start !== 0) { | |
| 43984 | + this.opts = { | |
| 43985 | + ...this.opts, | |
| 43986 | + headers: { | |
| 43987 | + ...this.opts.headers, | |
| 43988 | + range: `bytes=${this.start}-${this.end ?? ''}` | |
| 43989 | + } | |
| 43990 | + } | |
| 43991 | + } | |
| 43992 | + | |
| 43993 | + try { | |
| 43994 | + this.dispatch(this.opts, this) | |
| 43995 | + } catch (err) { | |
| 43996 | + this.handler.onError(err) | |
| 43997 | + } | |
| 43998 | + } | |
| 43999 | + } | |
| 44000 | +} | |
| 44001 | + | |
| 44002 | +module.exports = RetryHandler | |
| 44003 | + | |
| 44004 | + | |
| 44005 | +/***/ }), | |
| 44006 | + | |
| 44007 | +/***/ 4415: | |
| 44008 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44009 | + | |
| 44010 | +"use strict"; | |
| 44011 | + | |
| 44012 | + | |
| 44013 | +const RedirectHandler = __nccwpck_require__(8299) | |
| 44014 | + | |
| 44015 | +function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { | |
| 44016 | + return (dispatch) => { | |
| 44017 | + return function Intercept (opts, handler) { | |
| 44018 | + const { maxRedirections = defaultMaxRedirections } = opts | |
| 44019 | + | |
| 44020 | + if (!maxRedirections) { | |
| 44021 | + return dispatch(opts, handler) | |
| 44022 | + } | |
| 44023 | + | |
| 44024 | + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) | |
| 44025 | + opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. | |
| 44026 | + return dispatch(opts, redirectHandler) | |
| 44027 | + } | |
| 44028 | + } | |
| 44029 | +} | |
| 44030 | + | |
| 44031 | +module.exports = createRedirectInterceptor | |
| 44032 | + | |
| 44033 | + | |
| 44034 | +/***/ }), | |
| 44035 | + | |
| 44036 | +/***/ 2824: | |
| 44037 | +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { | |
| 44038 | + | |
| 44039 | +"use strict"; | |
| 44040 | + | |
| 44041 | +Object.defineProperty(exports, "__esModule", ({ value: true })); | |
| 44042 | +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; | |
| 44043 | +const utils_1 = __nccwpck_require__(172); | |
| 44044 | +// C headers | |
| 44045 | +var ERROR; | |
| 44046 | +(function (ERROR) { | |
| 44047 | + ERROR[ERROR["OK"] = 0] = "OK"; | |
| 44048 | + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; | |
| 44049 | + ERROR[ERROR["STRICT"] = 2] = "STRICT"; | |
| 44050 | + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; | |
| 44051 | + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; | |
| 44052 | + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; | |
| 44053 | + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; | |
| 44054 | + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; | |
| 44055 | + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; | |
| 44056 | + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; | |
| 44057 | + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; | |
| 44058 | + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; | |
| 44059 | + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; | |
| 44060 | + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; | |
| 44061 | + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; | |
| 44062 | + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; | |
| 44063 | + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; | |
| 44064 | + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; | |
| 44065 | + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; | |
| 44066 | + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; | |
| 44067 | + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; | |
| 44068 | + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; | |
| 44069 | + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; | |
| 44070 | + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; | |
| 44071 | + ERROR[ERROR["USER"] = 24] = "USER"; | |
| 44072 | +})(ERROR = exports.ERROR || (exports.ERROR = {})); | |
| 44073 | +var TYPE; | |
| 44074 | +(function (TYPE) { | |
| 44075 | + TYPE[TYPE["BOTH"] = 0] = "BOTH"; | |
| 44076 | + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; | |
| 44077 | + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; | |
| 44078 | +})(TYPE = exports.TYPE || (exports.TYPE = {})); | |
| 44079 | +var FLAGS; | |
| 44080 | +(function (FLAGS) { | |
| 44081 | + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; | |
| 44082 | + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; | |
| 44083 | + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; | |
| 44084 | + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; | |
| 44085 | + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; | |
| 44086 | + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; | |
| 44087 | + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; | |
| 44088 | + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; | |
| 44089 | + // 1 << 8 is unused | |
| 44090 | + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; | |
| 44091 | +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); | |
| 44092 | +var LENIENT_FLAGS; | |
| 44093 | +(function (LENIENT_FLAGS) { | |
| 44094 | + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; | |
| 44095 | + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; | |
| 44096 | + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; | |
| 44097 | +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); | |
| 44098 | +var METHODS; | |
| 44099 | +(function (METHODS) { | |
| 44100 | + METHODS[METHODS["DELETE"] = 0] = "DELETE"; | |
| 44101 | + METHODS[METHODS["GET"] = 1] = "GET"; | |
| 44102 | + METHODS[METHODS["HEAD"] = 2] = "HEAD"; | |
| 44103 | + METHODS[METHODS["POST"] = 3] = "POST"; | |
| 44104 | + METHODS[METHODS["PUT"] = 4] = "PUT"; | |
| 44105 | + /* pathological */ | |
| 44106 | + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; | |
| 44107 | + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; | |
| 44108 | + METHODS[METHODS["TRACE"] = 7] = "TRACE"; | |
| 44109 | + /* WebDAV */ | |
| 44110 | + METHODS[METHODS["COPY"] = 8] = "COPY"; | |
| 44111 | + METHODS[METHODS["LOCK"] = 9] = "LOCK"; | |
| 44112 | + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; | |
| 44113 | + METHODS[METHODS["MOVE"] = 11] = "MOVE"; | |
| 44114 | + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; | |
| 44115 | + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; | |
| 44116 | + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; | |
| 44117 | + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; | |
| 44118 | + METHODS[METHODS["BIND"] = 16] = "BIND"; | |
| 44119 | + METHODS[METHODS["REBIND"] = 17] = "REBIND"; | |
| 44120 | + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; | |
| 44121 | + METHODS[METHODS["ACL"] = 19] = "ACL"; | |
| 44122 | + /* subversion */ | |
| 44123 | + METHODS[METHODS["REPORT"] = 20] = "REPORT"; | |
| 44124 | + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; | |
| 44125 | + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; | |
| 44126 | + METHODS[METHODS["MERGE"] = 23] = "MERGE"; | |
| 44127 | + /* upnp */ | |
| 44128 | + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; | |
| 44129 | + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; | |
| 44130 | + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; | |
| 44131 | + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; | |
| 44132 | + /* RFC-5789 */ | |
| 44133 | + METHODS[METHODS["PATCH"] = 28] = "PATCH"; | |
| 44134 | + METHODS[METHODS["PURGE"] = 29] = "PURGE"; | |
| 44135 | + /* CalDAV */ | |
| 44136 | + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; | |
| 44137 | + /* RFC-2068, section 19.6.1.2 */ | |
| 44138 | + METHODS[METHODS["LINK"] = 31] = "LINK"; | |
| 44139 | + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; | |
| 44140 | + /* icecast */ | |
| 44141 | + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; | |
| 44142 | + /* RFC-7540, section 11.6 */ | |
| 44143 | + METHODS[METHODS["PRI"] = 34] = "PRI"; | |
| 44144 | + /* RFC-2326 RTSP */ | |
| 44145 | + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; | |
| 44146 | + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; | |
| 44147 | + METHODS[METHODS["SETUP"] = 37] = "SETUP"; | |
| 44148 | + METHODS[METHODS["PLAY"] = 38] = "PLAY"; | |
| 44149 | + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; | |
| 44150 | + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; | |
| 44151 | + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; | |
| 44152 | + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; | |
| 44153 | + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; | |
| 44154 | + METHODS[METHODS["RECORD"] = 44] = "RECORD"; | |
| 44155 | + /* RAOP */ | |
| 44156 | + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; | |
| 44157 | +})(METHODS = exports.METHODS || (exports.METHODS = {})); | |
| 44158 | +exports.METHODS_HTTP = [ | |
| 44159 | + METHODS.DELETE, | |
| 44160 | + METHODS.GET, | |
| 44161 | + METHODS.HEAD, | |
| 44162 | + METHODS.POST, | |
| 44163 | + METHODS.PUT, | |
| 44164 | + METHODS.CONNECT, | |
| 44165 | + METHODS.OPTIONS, | |
| 44166 | + METHODS.TRACE, | |
| 44167 | + METHODS.COPY, | |
| 44168 | + METHODS.LOCK, | |
| 44169 | + METHODS.MKCOL, | |
| 44170 | + METHODS.MOVE, | |
| 44171 | + METHODS.PROPFIND, | |
| 44172 | + METHODS.PROPPATCH, | |
| 44173 | + METHODS.SEARCH, | |
| 44174 | + METHODS.UNLOCK, | |
| 44175 | + METHODS.BIND, | |
| 44176 | + METHODS.REBIND, | |
| 44177 | + METHODS.UNBIND, | |
| 44178 | + METHODS.ACL, | |
| 44179 | + METHODS.REPORT, | |
| 44180 | + METHODS.MKACTIVITY, | |
| 44181 | + METHODS.CHECKOUT, | |
| 44182 | + METHODS.MERGE, | |
| 44183 | + METHODS['M-SEARCH'], | |
| 44184 | + METHODS.NOTIFY, | |
| 44185 | + METHODS.SUBSCRIBE, | |
| 44186 | + METHODS.UNSUBSCRIBE, | |
| 44187 | + METHODS.PATCH, | |
| 44188 | + METHODS.PURGE, | |
| 44189 | + METHODS.MKCALENDAR, | |
| 44190 | + METHODS.LINK, | |
| 44191 | + METHODS.UNLINK, | |
| 44192 | + METHODS.PRI, | |
| 44193 | + // TODO(indutny): should we allow it with HTTP? | |
| 44194 | + METHODS.SOURCE, | |
| 44195 | +]; | |
| 44196 | +exports.METHODS_ICE = [ | |
| 44197 | + METHODS.SOURCE, | |
| 44198 | +]; | |
| 44199 | +exports.METHODS_RTSP = [ | |
| 44200 | + METHODS.OPTIONS, | |
| 44201 | + METHODS.DESCRIBE, | |
| 44202 | + METHODS.ANNOUNCE, | |
| 44203 | + METHODS.SETUP, | |
| 44204 | + METHODS.PLAY, | |
| 44205 | + METHODS.PAUSE, | |
| 44206 | + METHODS.TEARDOWN, | |
| 44207 | + METHODS.GET_PARAMETER, | |
| 44208 | + METHODS.SET_PARAMETER, | |
| 44209 | + METHODS.REDIRECT, | |
| 44210 | + METHODS.RECORD, | |
| 44211 | + METHODS.FLUSH, | |
| 44212 | + // For AirPlay | |
| 44213 | + METHODS.GET, | |
| 44214 | + METHODS.POST, | |
| 44215 | +]; | |
| 44216 | +exports.METHOD_MAP = utils_1.enumToMap(METHODS); | |
| 44217 | +exports.H_METHOD_MAP = {}; | |
| 44218 | +Object.keys(exports.METHOD_MAP).forEach((key) => { | |
| 44219 | + if (/^H/.test(key)) { | |
| 44220 | + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; | |
| 44221 | + } | |
| 44222 | +}); | |
| 44223 | +var FINISH; | |
| 44224 | +(function (FINISH) { | |
| 44225 | + FINISH[FINISH["SAFE"] = 0] = "SAFE"; | |
| 44226 | + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; | |
| 44227 | + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; | |
| 44228 | +})(FINISH = exports.FINISH || (exports.FINISH = {})); | |
| 44229 | +exports.ALPHA = []; | |
| 44230 | +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { | |
| 44231 | + // Upper case | |
| 44232 | + exports.ALPHA.push(String.fromCharCode(i)); | |
| 44233 | + // Lower case | |
| 44234 | + exports.ALPHA.push(String.fromCharCode(i + 0x20)); | |
| 44235 | +} | |
| 44236 | +exports.NUM_MAP = { | |
| 44237 | + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, | |
| 44238 | + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, | |
| 44239 | +}; | |
| 44240 | +exports.HEX_MAP = { | |
| 44241 | + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, | |
| 44242 | + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, | |
| 44243 | + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, | |
| 44244 | + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, | |
| 44245 | +}; | |
| 44246 | +exports.NUM = [ | |
| 44247 | + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', | |
| 44248 | +]; | |
| 44249 | +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); | |
| 44250 | +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; | |
| 44251 | +exports.USERINFO_CHARS = exports.ALPHANUM | |
| 44252 | + .concat(exports.MARK) | |
| 44253 | + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); | |
| 44254 | +// TODO(indutny): use RFC | |
| 44255 | +exports.STRICT_URL_CHAR = [ | |
| 44256 | + '!', '"', '$', '%', '&', '\'', | |
| 44257 | + '(', ')', '*', '+', ',', '-', '.', '/', | |
| 44258 | + ':', ';', '<', '=', '>', | |
| 44259 | + '@', '[', '\\', ']', '^', '_', | |
| 44260 | + '`', | |
| 44261 | + '{', '|', '}', '~', | |
| 44262 | +].concat(exports.ALPHANUM); | |
| 44263 | +exports.URL_CHAR = exports.STRICT_URL_CHAR | |
| 44264 | + .concat(['\t', '\f']); | |
| 44265 | +// All characters with 0x80 bit set to 1 | |
| 44266 | +for (let i = 0x80; i <= 0xff; i++) { | |
| 44267 | + exports.URL_CHAR.push(i); | |
| 44268 | +} | |
| 44269 | +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); | |
| 44270 | +/* Tokens as defined by rfc 2616. Also lowercases them. | |
| 44271 | + * token = 1*<any CHAR except CTLs or separators> | |
| 44272 | + * separators = "(" | ")" | "<" | ">" | "@" | |
| 44273 | + * | "," | ";" | ":" | "\" | <"> | |
| 44274 | + * | "/" | "[" | "]" | "?" | "=" | |
| 44275 | + * | "{" | "}" | SP | HT | |
| 44276 | + */ | |
| 44277 | +exports.STRICT_TOKEN = [ | |
| 44278 | + '!', '#', '$', '%', '&', '\'', | |
| 44279 | + '*', '+', '-', '.', | |
| 44280 | + '^', '_', '`', | |
| 44281 | + '|', '~', | |
| 44282 | +].concat(exports.ALPHANUM); | |
| 44283 | +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); | |
| 44284 | +/* | |
| 44285 | + * Verify that a char is a valid visible (printable) US-ASCII | |
| 44286 | + * character or %x80-FF | |
| 44287 | + */ | |
| 44288 | +exports.HEADER_CHARS = ['\t']; | |
| 44289 | +for (let i = 32; i <= 255; i++) { | |
| 44290 | + if (i !== 127) { | |
| 44291 | + exports.HEADER_CHARS.push(i); | |
| 44292 | + } | |
| 44293 | +} | |
| 44294 | +// ',' = \x44 | |
| 44295 | +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); | |
| 44296 | +exports.MAJOR = exports.NUM_MAP; | |
| 44297 | +exports.MINOR = exports.MAJOR; | |
| 44298 | +var HEADER_STATE; | |
| 44299 | +(function (HEADER_STATE) { | |
| 44300 | + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; | |
| 44301 | + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; | |
| 44302 | + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; | |
| 44303 | + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; | |
| 44304 | + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; | |
| 44305 | + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; | |
| 44306 | + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; | |
| 44307 | + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; | |
| 44308 | + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; | |
| 44309 | +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); | |
| 44310 | +exports.SPECIAL_HEADERS = { | |
| 44311 | + 'connection': HEADER_STATE.CONNECTION, | |
| 44312 | + 'content-length': HEADER_STATE.CONTENT_LENGTH, | |
| 44313 | + 'proxy-connection': HEADER_STATE.CONNECTION, | |
| 44314 | + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, | |
| 44315 | + 'upgrade': HEADER_STATE.UPGRADE, | |
| 44316 | +}; | |
| 44317 | +//# sourceMappingURL=constants.js.map | |
| 44318 | + | |
| 44319 | +/***/ }), | |
| 44320 | + | |
| 44321 | +/***/ 3870: | |
| 44322 | +/***/ ((module) => { | |
| 44323 | + | |
| 44324 | +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9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AAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3Bxcn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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBB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AAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIAB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AAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8=' | |
| 44325 | + | |
| 44326 | + | |
| 44327 | +/***/ }), | |
| 44328 | + | |
| 44329 | +/***/ 3434: | |
| 44330 | +/***/ ((module) => { | |
| 44331 | + | |
| 44332 | +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAA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ELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh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EcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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AM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAi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kBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQx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5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==' | |
| 44333 | + | |
| 44334 | + | |
| 44335 | +/***/ }), | |
| 44336 | + | |
| 44337 | +/***/ 172: | |
| 44338 | +/***/ ((__unused_webpack_module, exports) => { | |
| 44339 | + | |
| 44340 | +"use strict"; | |
| 44341 | + | |
| 44342 | +Object.defineProperty(exports, "__esModule", ({ value: true })); | |
| 44343 | +exports.enumToMap = void 0; | |
| 44344 | +function enumToMap(obj) { | |
| 44345 | + const res = {}; | |
| 44346 | + Object.keys(obj).forEach((key) => { | |
| 44347 | + const value = obj[key]; | |
| 44348 | + if (typeof value === 'number') { | |
| 44349 | + res[key] = value; | |
| 44350 | + } | |
| 44351 | + }); | |
| 44352 | + return res; | |
| 44353 | +} | |
| 44354 | +exports.enumToMap = enumToMap; | |
| 44355 | +//# sourceMappingURL=utils.js.map | |
| 44356 | + | |
| 44357 | +/***/ }), | |
| 44358 | + | |
| 44359 | +/***/ 7501: | |
| 44360 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44361 | + | |
| 44362 | +"use strict"; | |
| 44363 | + | |
| 44364 | + | |
| 44365 | +const { kClients } = __nccwpck_require__(6443) | |
| 44366 | +const Agent = __nccwpck_require__(9965) | |
| 44367 | +const { | |
| 44368 | + kAgent, | |
| 44369 | + kMockAgentSet, | |
| 44370 | + kMockAgentGet, | |
| 44371 | + kDispatches, | |
| 44372 | + kIsMockActive, | |
| 44373 | + kNetConnect, | |
| 44374 | + kGetNetConnect, | |
| 44375 | + kOptions, | |
| 44376 | + kFactory | |
| 44377 | +} = __nccwpck_require__(1117) | |
| 44378 | +const MockClient = __nccwpck_require__(7365) | |
| 44379 | +const MockPool = __nccwpck_require__(4004) | |
| 44380 | +const { matchValue, buildMockOptions } = __nccwpck_require__(3397) | |
| 44381 | +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8707) | |
| 44382 | +const Dispatcher = __nccwpck_require__(992) | |
| 44383 | +const Pluralizer = __nccwpck_require__(1529) | |
| 44384 | +const PendingInterceptorsFormatter = __nccwpck_require__(6142) | |
| 44385 | + | |
| 44386 | +class FakeWeakRef { | |
| 44387 | + constructor (value) { | |
| 44388 | + this.value = value | |
| 44389 | + } | |
| 44390 | + | |
| 44391 | + deref () { | |
| 44392 | + return this.value | |
| 44393 | + } | |
| 44394 | +} | |
| 44395 | + | |
| 44396 | +class MockAgent extends Dispatcher { | |
| 44397 | + constructor (opts) { | |
| 44398 | + super(opts) | |
| 44399 | + | |
| 44400 | + this[kNetConnect] = true | |
| 44401 | + this[kIsMockActive] = true | |
| 44402 | + | |
| 44403 | + // Instantiate Agent and encapsulate | |
| 44404 | + if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { | |
| 44405 | + throw new InvalidArgumentError('Argument opts.agent must implement Agent') | |
| 44406 | + } | |
| 44407 | + const agent = opts && opts.agent ? opts.agent : new Agent(opts) | |
| 44408 | + this[kAgent] = agent | |
| 44409 | + | |
| 44410 | + this[kClients] = agent[kClients] | |
| 44411 | + this[kOptions] = buildMockOptions(opts) | |
| 44412 | + } | |
| 44413 | + | |
| 44414 | + get (origin) { | |
| 44415 | + let dispatcher = this[kMockAgentGet](origin) | |
| 44416 | + | |
| 44417 | + if (!dispatcher) { | |
| 44418 | + dispatcher = this[kFactory](origin) | |
| 44419 | + this[kMockAgentSet](origin, dispatcher) | |
| 44420 | + } | |
| 44421 | + return dispatcher | |
| 44422 | + } | |
| 44423 | + | |
| 44424 | + dispatch (opts, handler) { | |
| 44425 | + // Call MockAgent.get to perform additional setup before dispatching as normal | |
| 44426 | + this.get(opts.origin) | |
| 44427 | + return this[kAgent].dispatch(opts, handler) | |
| 44428 | + } | |
| 44429 | + | |
| 44430 | + async close () { | |
| 44431 | + await this[kAgent].close() | |
| 44432 | + this[kClients].clear() | |
| 44433 | + } | |
| 44434 | + | |
| 44435 | + deactivate () { | |
| 44436 | + this[kIsMockActive] = false | |
| 44437 | + } | |
| 44438 | + | |
| 44439 | + activate () { | |
| 44440 | + this[kIsMockActive] = true | |
| 44441 | + } | |
| 44442 | + | |
| 44443 | + enableNetConnect (matcher) { | |
| 44444 | + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { | |
| 44445 | + if (Array.isArray(this[kNetConnect])) { | |
| 44446 | + this[kNetConnect].push(matcher) | |
| 44447 | + } else { | |
| 44448 | + this[kNetConnect] = [matcher] | |
| 44449 | + } | |
| 44450 | + } else if (typeof matcher === 'undefined') { | |
| 44451 | + this[kNetConnect] = true | |
| 44452 | + } else { | |
| 44453 | + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') | |
| 44454 | + } | |
| 44455 | + } | |
| 44456 | + | |
| 44457 | + disableNetConnect () { | |
| 44458 | + this[kNetConnect] = false | |
| 44459 | + } | |
| 44460 | + | |
| 44461 | + // This is required to bypass issues caused by using global symbols - see: | |
| 44462 | + // https://github.com/nodejs/undici/issues/1447 | |
| 44463 | + get isMockActive () { | |
| 44464 | + return this[kIsMockActive] | |
| 44465 | + } | |
| 44466 | + | |
| 44467 | + [kMockAgentSet] (origin, dispatcher) { | |
| 44468 | + this[kClients].set(origin, new FakeWeakRef(dispatcher)) | |
| 44469 | + } | |
| 44470 | + | |
| 44471 | + [kFactory] (origin) { | |
| 44472 | + const mockOptions = Object.assign({ agent: this }, this[kOptions]) | |
| 44473 | + return this[kOptions] && this[kOptions].connections === 1 | |
| 44474 | + ? new MockClient(origin, mockOptions) | |
| 44475 | + : new MockPool(origin, mockOptions) | |
| 44476 | + } | |
| 44477 | + | |
| 44478 | + [kMockAgentGet] (origin) { | |
| 44479 | + // First check if we can immediately find it | |
| 44480 | + const ref = this[kClients].get(origin) | |
| 44481 | + if (ref) { | |
| 44482 | + return ref.deref() | |
| 44483 | + } | |
| 44484 | + | |
| 44485 | + // If the origin is not a string create a dummy parent pool and return to user | |
| 44486 | + if (typeof origin !== 'string') { | |
| 44487 | + const dispatcher = this[kFactory]('http://localhost:9999') | |
| 44488 | + this[kMockAgentSet](origin, dispatcher) | |
| 44489 | + return dispatcher | |
| 44490 | + } | |
| 44491 | + | |
| 44492 | + // If we match, create a pool and assign the same dispatches | |
| 44493 | + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { | |
| 44494 | + const nonExplicitDispatcher = nonExplicitRef.deref() | |
| 44495 | + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { | |
| 44496 | + const dispatcher = this[kFactory](origin) | |
| 44497 | + this[kMockAgentSet](origin, dispatcher) | |
| 44498 | + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] | |
| 44499 | + return dispatcher | |
| 44500 | + } | |
| 44501 | + } | |
| 44502 | + } | |
| 44503 | + | |
| 44504 | + [kGetNetConnect] () { | |
| 44505 | + return this[kNetConnect] | |
| 44506 | + } | |
| 44507 | + | |
| 44508 | + pendingInterceptors () { | |
| 44509 | + const mockAgentClients = this[kClients] | |
| 44510 | + | |
| 44511 | + return Array.from(mockAgentClients.entries()) | |
| 44512 | + .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) | |
| 44513 | + .filter(({ pending }) => pending) | |
| 44514 | + } | |
| 44515 | + | |
| 44516 | + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { | |
| 44517 | + const pending = this.pendingInterceptors() | |
| 44518 | + | |
| 44519 | + if (pending.length === 0) { | |
| 44520 | + return | |
| 44521 | + } | |
| 44522 | + | |
| 44523 | + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) | |
| 44524 | + | |
| 44525 | + throw new UndiciError(` | |
| 44526 | +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: | |
| 44527 | + | |
| 44528 | +${pendingInterceptorsFormatter.format(pending)} | |
| 44529 | +`.trim()) | |
| 44530 | + } | |
| 44531 | +} | |
| 44532 | + | |
| 44533 | +module.exports = MockAgent | |
| 44534 | + | |
| 44535 | + | |
| 44536 | +/***/ }), | |
| 44537 | + | |
| 44538 | +/***/ 7365: | |
| 44539 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44540 | + | |
| 44541 | +"use strict"; | |
| 44542 | + | |
| 44543 | + | |
| 44544 | +const { promisify } = __nccwpck_require__(9023) | |
| 44545 | +const Client = __nccwpck_require__(6197) | |
| 44546 | +const { buildMockDispatch } = __nccwpck_require__(3397) | |
| 44547 | +const { | |
| 44548 | + kDispatches, | |
| 44549 | + kMockAgent, | |
| 44550 | + kClose, | |
| 44551 | + kOriginalClose, | |
| 44552 | + kOrigin, | |
| 44553 | + kOriginalDispatch, | |
| 44554 | + kConnected | |
| 44555 | +} = __nccwpck_require__(1117) | |
| 44556 | +const { MockInterceptor } = __nccwpck_require__(1511) | |
| 44557 | +const Symbols = __nccwpck_require__(6443) | |
| 44558 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 44559 | + | |
| 44560 | +/** | |
| 44561 | + * MockClient provides an API that extends the Client to influence the mockDispatches. | |
| 44562 | + */ | |
| 44563 | +class MockClient extends Client { | |
| 44564 | + constructor (origin, opts) { | |
| 44565 | + super(origin, opts) | |
| 44566 | + | |
| 44567 | + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { | |
| 44568 | + throw new InvalidArgumentError('Argument opts.agent must implement Agent') | |
| 44569 | + } | |
| 44570 | + | |
| 44571 | + this[kMockAgent] = opts.agent | |
| 44572 | + this[kOrigin] = origin | |
| 44573 | + this[kDispatches] = [] | |
| 44574 | + this[kConnected] = 1 | |
| 44575 | + this[kOriginalDispatch] = this.dispatch | |
| 44576 | + this[kOriginalClose] = this.close.bind(this) | |
| 44577 | + | |
| 44578 | + this.dispatch = buildMockDispatch.call(this) | |
| 44579 | + this.close = this[kClose] | |
| 44580 | + } | |
| 44581 | + | |
| 44582 | + get [Symbols.kConnected] () { | |
| 44583 | + return this[kConnected] | |
| 44584 | + } | |
| 44585 | + | |
| 44586 | + /** | |
| 44587 | + * Sets up the base interceptor for mocking replies from undici. | |
| 44588 | + */ | |
| 44589 | + intercept (opts) { | |
| 44590 | + return new MockInterceptor(opts, this[kDispatches]) | |
| 44591 | + } | |
| 44592 | + | |
| 44593 | + async [kClose] () { | |
| 44594 | + await promisify(this[kOriginalClose])() | |
| 44595 | + this[kConnected] = 0 | |
| 44596 | + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) | |
| 44597 | + } | |
| 44598 | +} | |
| 44599 | + | |
| 44600 | +module.exports = MockClient | |
| 44601 | + | |
| 44602 | + | |
| 44603 | +/***/ }), | |
| 44604 | + | |
| 44605 | +/***/ 2429: | |
| 44606 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44607 | + | |
| 44608 | +"use strict"; | |
| 44609 | + | |
| 44610 | + | |
| 44611 | +const { UndiciError } = __nccwpck_require__(8707) | |
| 44612 | + | |
| 44613 | +class MockNotMatchedError extends UndiciError { | |
| 44614 | + constructor (message) { | |
| 44615 | + super(message) | |
| 44616 | + Error.captureStackTrace(this, MockNotMatchedError) | |
| 44617 | + this.name = 'MockNotMatchedError' | |
| 44618 | + this.message = message || 'The request does not match any registered mock dispatches' | |
| 44619 | + this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' | |
| 44620 | + } | |
| 44621 | +} | |
| 44622 | + | |
| 44623 | +module.exports = { | |
| 44624 | + MockNotMatchedError | |
| 44625 | +} | |
| 44626 | + | |
| 44627 | + | |
| 44628 | +/***/ }), | |
| 44629 | + | |
| 44630 | +/***/ 1511: | |
| 44631 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44632 | + | |
| 44633 | +"use strict"; | |
| 44634 | + | |
| 44635 | + | |
| 44636 | +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397) | |
| 44637 | +const { | |
| 44638 | + kDispatches, | |
| 44639 | + kDispatchKey, | |
| 44640 | + kDefaultHeaders, | |
| 44641 | + kDefaultTrailers, | |
| 44642 | + kContentLength, | |
| 44643 | + kMockDispatch | |
| 44644 | +} = __nccwpck_require__(1117) | |
| 44645 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 44646 | +const { buildURL } = __nccwpck_require__(3440) | |
| 44647 | + | |
| 44648 | +/** | |
| 44649 | + * Defines the scope API for an interceptor reply | |
| 44650 | + */ | |
| 44651 | +class MockScope { | |
| 44652 | + constructor (mockDispatch) { | |
| 44653 | + this[kMockDispatch] = mockDispatch | |
| 44654 | + } | |
| 44655 | + | |
| 44656 | + /** | |
| 44657 | + * Delay a reply by a set amount in ms. | |
| 44658 | + */ | |
| 44659 | + delay (waitInMs) { | |
| 44660 | + if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { | |
| 44661 | + throw new InvalidArgumentError('waitInMs must be a valid integer > 0') | |
| 44662 | + } | |
| 44663 | + | |
| 44664 | + this[kMockDispatch].delay = waitInMs | |
| 44665 | + return this | |
| 44666 | + } | |
| 44667 | + | |
| 44668 | + /** | |
| 44669 | + * For a defined reply, never mark as consumed. | |
| 44670 | + */ | |
| 44671 | + persist () { | |
| 44672 | + this[kMockDispatch].persist = true | |
| 44673 | + return this | |
| 44674 | + } | |
| 44675 | + | |
| 44676 | + /** | |
| 44677 | + * Allow one to define a reply for a set amount of matching requests. | |
| 44678 | + */ | |
| 44679 | + times (repeatTimes) { | |
| 44680 | + if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { | |
| 44681 | + throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') | |
| 44682 | + } | |
| 44683 | + | |
| 44684 | + this[kMockDispatch].times = repeatTimes | |
| 44685 | + return this | |
| 44686 | + } | |
| 44687 | +} | |
| 44688 | + | |
| 44689 | +/** | |
| 44690 | + * Defines an interceptor for a Mock | |
| 44691 | + */ | |
| 44692 | +class MockInterceptor { | |
| 44693 | + constructor (opts, mockDispatches) { | |
| 44694 | + if (typeof opts !== 'object') { | |
| 44695 | + throw new InvalidArgumentError('opts must be an object') | |
| 44696 | + } | |
| 44697 | + if (typeof opts.path === 'undefined') { | |
| 44698 | + throw new InvalidArgumentError('opts.path must be defined') | |
| 44699 | + } | |
| 44700 | + if (typeof opts.method === 'undefined') { | |
| 44701 | + opts.method = 'GET' | |
| 44702 | + } | |
| 44703 | + // See https://github.com/nodejs/undici/issues/1245 | |
| 44704 | + // As per RFC 3986, clients are not supposed to send URI | |
| 44705 | + // fragments to servers when they retrieve a document, | |
| 44706 | + if (typeof opts.path === 'string') { | |
| 44707 | + if (opts.query) { | |
| 44708 | + opts.path = buildURL(opts.path, opts.query) | |
| 44709 | + } else { | |
| 44710 | + // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 | |
| 44711 | + const parsedURL = new URL(opts.path, 'data://') | |
| 44712 | + opts.path = parsedURL.pathname + parsedURL.search | |
| 44713 | + } | |
| 44714 | + } | |
| 44715 | + if (typeof opts.method === 'string') { | |
| 44716 | + opts.method = opts.method.toUpperCase() | |
| 44717 | + } | |
| 44718 | + | |
| 44719 | + this[kDispatchKey] = buildKey(opts) | |
| 44720 | + this[kDispatches] = mockDispatches | |
| 44721 | + this[kDefaultHeaders] = {} | |
| 44722 | + this[kDefaultTrailers] = {} | |
| 44723 | + this[kContentLength] = false | |
| 44724 | + } | |
| 44725 | + | |
| 44726 | + createMockScopeDispatchData (statusCode, data, responseOptions = {}) { | |
| 44727 | + const responseData = getResponseData(data) | |
| 44728 | + const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} | |
| 44729 | + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } | |
| 44730 | + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } | |
| 44731 | + | |
| 44732 | + return { statusCode, data, headers, trailers } | |
| 44733 | + } | |
| 44734 | + | |
| 44735 | + validateReplyParameters (statusCode, data, responseOptions) { | |
| 44736 | + if (typeof statusCode === 'undefined') { | |
| 44737 | + throw new InvalidArgumentError('statusCode must be defined') | |
| 44738 | + } | |
| 44739 | + if (typeof data === 'undefined') { | |
| 44740 | + throw new InvalidArgumentError('data must be defined') | |
| 44741 | + } | |
| 44742 | + if (typeof responseOptions !== 'object') { | |
| 44743 | + throw new InvalidArgumentError('responseOptions must be an object') | |
| 44744 | + } | |
| 44745 | + } | |
| 44746 | + | |
| 44747 | + /** | |
| 44748 | + * Mock an undici request with a defined reply. | |
| 44749 | + */ | |
| 44750 | + reply (replyData) { | |
| 44751 | + // Values of reply aren't available right now as they | |
| 44752 | + // can only be available when the reply callback is invoked. | |
| 44753 | + if (typeof replyData === 'function') { | |
| 44754 | + // We'll first wrap the provided callback in another function, | |
| 44755 | + // this function will properly resolve the data from the callback | |
| 44756 | + // when invoked. | |
| 44757 | + const wrappedDefaultsCallback = (opts) => { | |
| 44758 | + // Our reply options callback contains the parameter for statusCode, data and options. | |
| 44759 | + const resolvedData = replyData(opts) | |
| 44760 | + | |
| 44761 | + // Check if it is in the right format | |
| 44762 | + if (typeof resolvedData !== 'object') { | |
| 44763 | + throw new InvalidArgumentError('reply options callback must return an object') | |
| 44764 | + } | |
| 44765 | + | |
| 44766 | + const { statusCode, data = '', responseOptions = {} } = resolvedData | |
| 44767 | + this.validateReplyParameters(statusCode, data, responseOptions) | |
| 44768 | + // Since the values can be obtained immediately we return them | |
| 44769 | + // from this higher order function that will be resolved later. | |
| 44770 | + return { | |
| 44771 | + ...this.createMockScopeDispatchData(statusCode, data, responseOptions) | |
| 44772 | + } | |
| 44773 | + } | |
| 44774 | + | |
| 44775 | + // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. | |
| 44776 | + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) | |
| 44777 | + return new MockScope(newMockDispatch) | |
| 44778 | + } | |
| 44779 | + | |
| 44780 | + // We can have either one or three parameters, if we get here, | |
| 44781 | + // we should have 1-3 parameters. So we spread the arguments of | |
| 44782 | + // this function to obtain the parameters, since replyData will always | |
| 44783 | + // just be the statusCode. | |
| 44784 | + const [statusCode, data = '', responseOptions = {}] = [...arguments] | |
| 44785 | + this.validateReplyParameters(statusCode, data, responseOptions) | |
| 44786 | + | |
| 44787 | + // Send in-already provided data like usual | |
| 44788 | + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) | |
| 44789 | + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) | |
| 44790 | + return new MockScope(newMockDispatch) | |
| 44791 | + } | |
| 44792 | + | |
| 44793 | + /** | |
| 44794 | + * Mock an undici request with a defined error. | |
| 44795 | + */ | |
| 44796 | + replyWithError (error) { | |
| 44797 | + if (typeof error === 'undefined') { | |
| 44798 | + throw new InvalidArgumentError('error must be defined') | |
| 44799 | + } | |
| 44800 | + | |
| 44801 | + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) | |
| 44802 | + return new MockScope(newMockDispatch) | |
| 44803 | + } | |
| 44804 | + | |
| 44805 | + /** | |
| 44806 | + * Set default reply headers on the interceptor for subsequent replies | |
| 44807 | + */ | |
| 44808 | + defaultReplyHeaders (headers) { | |
| 44809 | + if (typeof headers === 'undefined') { | |
| 44810 | + throw new InvalidArgumentError('headers must be defined') | |
| 44811 | + } | |
| 44812 | + | |
| 44813 | + this[kDefaultHeaders] = headers | |
| 44814 | + return this | |
| 44815 | + } | |
| 44816 | + | |
| 44817 | + /** | |
| 44818 | + * Set default reply trailers on the interceptor for subsequent replies | |
| 44819 | + */ | |
| 44820 | + defaultReplyTrailers (trailers) { | |
| 44821 | + if (typeof trailers === 'undefined') { | |
| 44822 | + throw new InvalidArgumentError('trailers must be defined') | |
| 44823 | + } | |
| 44824 | + | |
| 44825 | + this[kDefaultTrailers] = trailers | |
| 44826 | + return this | |
| 44827 | + } | |
| 44828 | + | |
| 44829 | + /** | |
| 44830 | + * Set reply content length header for replies on the interceptor | |
| 44831 | + */ | |
| 44832 | + replyContentLength () { | |
| 44833 | + this[kContentLength] = true | |
| 44834 | + return this | |
| 44835 | + } | |
| 44836 | +} | |
| 44837 | + | |
| 44838 | +module.exports.MockInterceptor = MockInterceptor | |
| 44839 | +module.exports.MockScope = MockScope | |
| 44840 | + | |
| 44841 | + | |
| 44842 | +/***/ }), | |
| 44843 | + | |
| 44844 | +/***/ 4004: | |
| 44845 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44846 | + | |
| 44847 | +"use strict"; | |
| 44848 | + | |
| 44849 | + | |
| 44850 | +const { promisify } = __nccwpck_require__(9023) | |
| 44851 | +const Pool = __nccwpck_require__(5076) | |
| 44852 | +const { buildMockDispatch } = __nccwpck_require__(3397) | |
| 44853 | +const { | |
| 44854 | + kDispatches, | |
| 44855 | + kMockAgent, | |
| 44856 | + kClose, | |
| 44857 | + kOriginalClose, | |
| 44858 | + kOrigin, | |
| 44859 | + kOriginalDispatch, | |
| 44860 | + kConnected | |
| 44861 | +} = __nccwpck_require__(1117) | |
| 44862 | +const { MockInterceptor } = __nccwpck_require__(1511) | |
| 44863 | +const Symbols = __nccwpck_require__(6443) | |
| 44864 | +const { InvalidArgumentError } = __nccwpck_require__(8707) | |
| 44865 | + | |
| 44866 | +/** | |
| 44867 | + * MockPool provides an API that extends the Pool to influence the mockDispatches. | |
| 44868 | + */ | |
| 44869 | +class MockPool extends Pool { | |
| 44870 | + constructor (origin, opts) { | |
| 44871 | + super(origin, opts) | |
| 44872 | + | |
| 44873 | + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { | |
| 44874 | + throw new InvalidArgumentError('Argument opts.agent must implement Agent') | |
| 44875 | + } | |
| 44876 | + | |
| 44877 | + this[kMockAgent] = opts.agent | |
| 44878 | + this[kOrigin] = origin | |
| 44879 | + this[kDispatches] = [] | |
| 44880 | + this[kConnected] = 1 | |
| 44881 | + this[kOriginalDispatch] = this.dispatch | |
| 44882 | + this[kOriginalClose] = this.close.bind(this) | |
| 44883 | + | |
| 44884 | + this.dispatch = buildMockDispatch.call(this) | |
| 44885 | + this.close = this[kClose] | |
| 44886 | + } | |
| 44887 | + | |
| 44888 | + get [Symbols.kConnected] () { | |
| 44889 | + return this[kConnected] | |
| 44890 | + } | |
| 44891 | + | |
| 44892 | + /** | |
| 44893 | + * Sets up the base interceptor for mocking replies from undici. | |
| 44894 | + */ | |
| 44895 | + intercept (opts) { | |
| 44896 | + return new MockInterceptor(opts, this[kDispatches]) | |
| 44897 | + } | |
| 44898 | + | |
| 44899 | + async [kClose] () { | |
| 44900 | + await promisify(this[kOriginalClose])() | |
| 44901 | + this[kConnected] = 0 | |
| 44902 | + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) | |
| 44903 | + } | |
| 44904 | +} | |
| 44905 | + | |
| 44906 | +module.exports = MockPool | |
| 44907 | + | |
| 44908 | + | |
| 44909 | +/***/ }), | |
| 44910 | + | |
| 44911 | +/***/ 1117: | |
| 44912 | +/***/ ((module) => { | |
| 44913 | + | |
| 44914 | +"use strict"; | |
| 44915 | + | |
| 44916 | + | |
| 44917 | +module.exports = { | |
| 44918 | + kAgent: Symbol('agent'), | |
| 44919 | + kOptions: Symbol('options'), | |
| 44920 | + kFactory: Symbol('factory'), | |
| 44921 | + kDispatches: Symbol('dispatches'), | |
| 44922 | + kDispatchKey: Symbol('dispatch key'), | |
| 44923 | + kDefaultHeaders: Symbol('default headers'), | |
| 44924 | + kDefaultTrailers: Symbol('default trailers'), | |
| 44925 | + kContentLength: Symbol('content length'), | |
| 44926 | + kMockAgent: Symbol('mock agent'), | |
| 44927 | + kMockAgentSet: Symbol('mock agent set'), | |
| 44928 | + kMockAgentGet: Symbol('mock agent get'), | |
| 44929 | + kMockDispatch: Symbol('mock dispatch'), | |
| 44930 | + kClose: Symbol('close'), | |
| 44931 | + kOriginalClose: Symbol('original agent close'), | |
| 44932 | + kOrigin: Symbol('origin'), | |
| 44933 | + kIsMockActive: Symbol('is mock active'), | |
| 44934 | + kNetConnect: Symbol('net connect'), | |
| 44935 | + kGetNetConnect: Symbol('get net connect'), | |
| 44936 | + kConnected: Symbol('connected') | |
| 44937 | +} | |
| 44938 | + | |
| 44939 | + | |
| 44940 | +/***/ }), | |
| 44941 | + | |
| 44942 | +/***/ 3397: | |
| 44943 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 44944 | + | |
| 44945 | +"use strict"; | |
| 44946 | + | |
| 44947 | + | |
| 44948 | +const { MockNotMatchedError } = __nccwpck_require__(2429) | |
| 44949 | +const { | |
| 44950 | + kDispatches, | |
| 44951 | + kMockAgent, | |
| 44952 | + kOriginalDispatch, | |
| 44953 | + kOrigin, | |
| 44954 | + kGetNetConnect | |
| 44955 | +} = __nccwpck_require__(1117) | |
| 44956 | +const { buildURL, nop } = __nccwpck_require__(3440) | |
| 44957 | +const { STATUS_CODES } = __nccwpck_require__(8611) | |
| 44958 | +const { | |
| 44959 | + types: { | |
| 44960 | + isPromise | |
| 44961 | + } | |
| 44962 | +} = __nccwpck_require__(9023) | |
| 44963 | + | |
| 44964 | +function matchValue (match, value) { | |
| 44965 | + if (typeof match === 'string') { | |
| 44966 | + return match === value | |
| 44967 | + } | |
| 44968 | + if (match instanceof RegExp) { | |
| 44969 | + return match.test(value) | |
| 44970 | + } | |
| 44971 | + if (typeof match === 'function') { | |
| 44972 | + return match(value) === true | |
| 44973 | + } | |
| 44974 | + return false | |
| 44975 | +} | |
| 44976 | + | |
| 44977 | +function lowerCaseEntries (headers) { | |
| 44978 | + return Object.fromEntries( | |
| 44979 | + Object.entries(headers).map(([headerName, headerValue]) => { | |
| 44980 | + return [headerName.toLocaleLowerCase(), headerValue] | |
| 44981 | + }) | |
| 44982 | + ) | |
| 44983 | +} | |
| 44984 | + | |
| 44985 | +/** | |
| 44986 | + * @param {import('../../index').Headers|string[]|Record<string, string>} headers | |
| 44987 | + * @param {string} key | |
| 44988 | + */ | |
| 44989 | +function getHeaderByName (headers, key) { | |
| 44990 | + if (Array.isArray(headers)) { | |
| 44991 | + for (let i = 0; i < headers.length; i += 2) { | |
| 44992 | + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { | |
| 44993 | + return headers[i + 1] | |
| 44994 | + } | |
| 44995 | + } | |
| 44996 | + | |
| 44997 | + return undefined | |
| 44998 | + } else if (typeof headers.get === 'function') { | |
| 44999 | + return headers.get(key) | |
| 45000 | + } else { | |
| 45001 | + return lowerCaseEntries(headers)[key.toLocaleLowerCase()] | |
| 45002 | + } | |
| 45003 | +} | |
| 45004 | + | |
| 45005 | +/** @param {string[]} headers */ | |
| 45006 | +function buildHeadersFromArray (headers) { // fetch HeadersList | |
| 45007 | + const clone = headers.slice() | |
| 45008 | + const entries = [] | |
| 45009 | + for (let index = 0; index < clone.length; index += 2) { | |
| 45010 | + entries.push([clone[index], clone[index + 1]]) | |
| 45011 | + } | |
| 45012 | + return Object.fromEntries(entries) | |
| 45013 | +} | |
| 45014 | + | |
| 45015 | +function matchHeaders (mockDispatch, headers) { | |
| 45016 | + if (typeof mockDispatch.headers === 'function') { | |
| 45017 | + if (Array.isArray(headers)) { // fetch HeadersList | |
| 45018 | + headers = buildHeadersFromArray(headers) | |
| 45019 | + } | |
| 45020 | + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) | |
| 45021 | + } | |
| 45022 | + if (typeof mockDispatch.headers === 'undefined') { | |
| 45023 | + return true | |
| 45024 | + } | |
| 45025 | + if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { | |
| 45026 | + return false | |
| 45027 | + } | |
| 45028 | + | |
| 45029 | + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { | |
| 45030 | + const headerValue = getHeaderByName(headers, matchHeaderName) | |
| 45031 | + | |
| 45032 | + if (!matchValue(matchHeaderValue, headerValue)) { | |
| 45033 | + return false | |
| 45034 | + } | |
| 45035 | + } | |
| 45036 | + return true | |
| 45037 | +} | |
| 45038 | + | |
| 45039 | +function safeUrl (path) { | |
| 45040 | + if (typeof path !== 'string') { | |
| 45041 | + return path | |
| 45042 | + } | |
| 45043 | + | |
| 45044 | + const pathSegments = path.split('?') | |
| 45045 | + | |
| 45046 | + if (pathSegments.length !== 2) { | |
| 45047 | + return path | |
| 45048 | + } | |
| 45049 | + | |
| 45050 | + const qp = new URLSearchParams(pathSegments.pop()) | |
| 45051 | + qp.sort() | |
| 45052 | + return [...pathSegments, qp.toString()].join('?') | |
| 45053 | +} | |
| 45054 | + | |
| 45055 | +function matchKey (mockDispatch, { path, method, body, headers }) { | |
| 45056 | + const pathMatch = matchValue(mockDispatch.path, path) | |
| 45057 | + const methodMatch = matchValue(mockDispatch.method, method) | |
| 45058 | + const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true | |
| 45059 | + const headersMatch = matchHeaders(mockDispatch, headers) | |
| 45060 | + return pathMatch && methodMatch && bodyMatch && headersMatch | |
| 45061 | +} | |
| 45062 | + | |
| 45063 | +function getResponseData (data) { | |
| 45064 | + if (Buffer.isBuffer(data)) { | |
| 45065 | + return data | |
| 45066 | + } else if (typeof data === 'object') { | |
| 45067 | + return JSON.stringify(data) | |
| 45068 | + } else { | |
| 45069 | + return data.toString() | |
| 45070 | + } | |
| 45071 | +} | |
| 45072 | + | |
| 45073 | +function getMockDispatch (mockDispatches, key) { | |
| 45074 | + const basePath = key.query ? buildURL(key.path, key.query) : key.path | |
| 45075 | + const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath | |
| 45076 | + | |
| 45077 | + // Match path | |
| 45078 | + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) | |
| 45079 | + if (matchedMockDispatches.length === 0) { | |
| 45080 | + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) | |
| 45081 | + } | |
| 45082 | + | |
| 45083 | + // Match method | |
| 45084 | + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) | |
| 45085 | + if (matchedMockDispatches.length === 0) { | |
| 45086 | + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) | |
| 45087 | + } | |
| 45088 | + | |
| 45089 | + // Match body | |
| 45090 | + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) | |
| 45091 | + if (matchedMockDispatches.length === 0) { | |
| 45092 | + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) | |
| 45093 | + } | |
| 45094 | + | |
| 45095 | + // Match headers | |
| 45096 | + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) | |
| 45097 | + if (matchedMockDispatches.length === 0) { | |
| 45098 | + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) | |
| 45099 | + } | |
| 45100 | + | |
| 45101 | + return matchedMockDispatches[0] | |
| 45102 | +} | |
| 45103 | + | |
| 45104 | +function addMockDispatch (mockDispatches, key, data) { | |
| 45105 | + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } | |
| 45106 | + const replyData = typeof data === 'function' ? { callback: data } : { ...data } | |
| 45107 | + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } | |
| 45108 | + mockDispatches.push(newMockDispatch) | |
| 45109 | + return newMockDispatch | |
| 45110 | +} | |
| 45111 | + | |
| 45112 | +function deleteMockDispatch (mockDispatches, key) { | |
| 45113 | + const index = mockDispatches.findIndex(dispatch => { | |
| 45114 | + if (!dispatch.consumed) { | |
| 45115 | + return false | |
| 45116 | + } | |
| 45117 | + return matchKey(dispatch, key) | |
| 45118 | + }) | |
| 45119 | + if (index !== -1) { | |
| 45120 | + mockDispatches.splice(index, 1) | |
| 45121 | + } | |
| 45122 | +} | |
| 45123 | + | |
| 45124 | +function buildKey (opts) { | |
| 45125 | + const { path, method, body, headers, query } = opts | |
| 45126 | + return { | |
| 45127 | + path, | |
| 45128 | + method, | |
| 45129 | + body, | |
| 45130 | + headers, | |
| 45131 | + query | |
| 45132 | + } | |
| 45133 | +} | |
| 45134 | + | |
| 45135 | +function generateKeyValues (data) { | |
| 45136 | + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ | |
| 45137 | + ...keyValuePairs, | |
| 45138 | + Buffer.from(`${key}`), | |
| 45139 | + Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) | |
| 45140 | + ], []) | |
| 45141 | +} | |
| 45142 | + | |
| 45143 | +/** | |
| 45144 | + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status | |
| 45145 | + * @param {number} statusCode | |
| 45146 | + */ | |
| 45147 | +function getStatusText (statusCode) { | |
| 45148 | + return STATUS_CODES[statusCode] || 'unknown' | |
| 45149 | +} | |
| 45150 | + | |
| 45151 | +async function getResponse (body) { | |
| 45152 | + const buffers = [] | |
| 45153 | + for await (const data of body) { | |
| 45154 | + buffers.push(data) | |
| 45155 | + } | |
| 45156 | + return Buffer.concat(buffers).toString('utf8') | |
| 45157 | +} | |
| 45158 | + | |
| 45159 | +/** | |
| 45160 | + * Mock dispatch function used to simulate undici dispatches | |
| 45161 | + */ | |
| 45162 | +function mockDispatch (opts, handler) { | |
| 45163 | + // Get mock dispatch from built key | |
| 45164 | + const key = buildKey(opts) | |
| 45165 | + const mockDispatch = getMockDispatch(this[kDispatches], key) | |
| 45166 | + | |
| 45167 | + mockDispatch.timesInvoked++ | |
| 45168 | + | |
| 45169 | + // Here's where we resolve a callback if a callback is present for the dispatch data. | |
| 45170 | + if (mockDispatch.data.callback) { | |
| 45171 | + mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } | |
| 45172 | + } | |
| 45173 | + | |
| 45174 | + // Parse mockDispatch data | |
| 45175 | + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch | |
| 45176 | + const { timesInvoked, times } = mockDispatch | |
| 45177 | + | |
| 45178 | + // If it's used up and not persistent, mark as consumed | |
| 45179 | + mockDispatch.consumed = !persist && timesInvoked >= times | |
| 45180 | + mockDispatch.pending = timesInvoked < times | |
| 45181 | + | |
| 45182 | + // If specified, trigger dispatch error | |
| 45183 | + if (error !== null) { | |
| 45184 | + deleteMockDispatch(this[kDispatches], key) | |
| 45185 | + handler.onError(error) | |
| 45186 | + return true | |
| 45187 | + } | |
| 45188 | + | |
| 45189 | + // Handle the request with a delay if necessary | |
| 45190 | + if (typeof delay === 'number' && delay > 0) { | |
| 45191 | + setTimeout(() => { | |
| 45192 | + handleReply(this[kDispatches]) | |
| 45193 | + }, delay) | |
| 45194 | + } else { | |
| 45195 | + handleReply(this[kDispatches]) | |
| 45196 | + } | |
| 45197 | + | |
| 45198 | + function handleReply (mockDispatches, _data = data) { | |
| 45199 | + // fetch's HeadersList is a 1D string array | |
| 45200 | + const optsHeaders = Array.isArray(opts.headers) | |
| 45201 | + ? buildHeadersFromArray(opts.headers) | |
| 45202 | + : opts.headers | |
| 45203 | + const body = typeof _data === 'function' | |
| 45204 | + ? _data({ ...opts, headers: optsHeaders }) | |
| 45205 | + : _data | |
| 45206 | + | |
| 45207 | + // util.types.isPromise is likely needed for jest. | |
| 45208 | + if (isPromise(body)) { | |
| 45209 | + // If handleReply is asynchronous, throwing an error | |
| 45210 | + // in the callback will reject the promise, rather than | |
| 45211 | + // synchronously throw the error, which breaks some tests. | |
| 45212 | + // Rather, we wait for the callback to resolve if it is a | |
| 45213 | + // promise, and then re-run handleReply with the new body. | |
| 45214 | + body.then((newData) => handleReply(mockDispatches, newData)) | |
| 45215 | + return | |
| 45216 | + } | |
| 45217 | + | |
| 45218 | + const responseData = getResponseData(body) | |
| 45219 | + const responseHeaders = generateKeyValues(headers) | |
| 45220 | + const responseTrailers = generateKeyValues(trailers) | |
| 45221 | + | |
| 45222 | + handler.abort = nop | |
| 45223 | + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) | |
| 45224 | + handler.onData(Buffer.from(responseData)) | |
| 45225 | + handler.onComplete(responseTrailers) | |
| 45226 | + deleteMockDispatch(mockDispatches, key) | |
| 45227 | + } | |
| 45228 | + | |
| 45229 | + function resume () {} | |
| 45230 | + | |
| 45231 | + return true | |
| 45232 | +} | |
| 45233 | + | |
| 45234 | +function buildMockDispatch () { | |
| 45235 | + const agent = this[kMockAgent] | |
| 45236 | + const origin = this[kOrigin] | |
| 45237 | + const originalDispatch = this[kOriginalDispatch] | |
| 45238 | + | |
| 45239 | + return function dispatch (opts, handler) { | |
| 45240 | + if (agent.isMockActive) { | |
| 45241 | + try { | |
| 45242 | + mockDispatch.call(this, opts, handler) | |
| 45243 | + } catch (error) { | |
| 45244 | + if (error instanceof MockNotMatchedError) { | |
| 45245 | + const netConnect = agent[kGetNetConnect]() | |
| 45246 | + if (netConnect === false) { | |
| 45247 | + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) | |
| 45248 | + } | |
| 45249 | + if (checkNetConnect(netConnect, origin)) { | |
| 45250 | + originalDispatch.call(this, opts, handler) | |
| 45251 | + } else { | |
| 45252 | + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) | |
| 45253 | + } | |
| 45254 | + } else { | |
| 45255 | + throw error | |
| 45256 | + } | |
| 45257 | + } | |
| 45258 | + } else { | |
| 45259 | + originalDispatch.call(this, opts, handler) | |
| 45260 | + } | |
| 45261 | + } | |
| 45262 | +} | |
| 45263 | + | |
| 45264 | +function checkNetConnect (netConnect, origin) { | |
| 45265 | + const url = new URL(origin) | |
| 45266 | + if (netConnect === true) { | |
| 45267 | + return true | |
| 45268 | + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { | |
| 45269 | + return true | |
| 45270 | + } | |
| 45271 | + return false | |
| 45272 | +} | |
| 45273 | + | |
| 45274 | +function buildMockOptions (opts) { | |
| 45275 | + if (opts) { | |
| 45276 | + const { agent, ...mockOptions } = opts | |
| 45277 | + return mockOptions | |
| 45278 | + } | |
| 45279 | +} | |
| 45280 | + | |
| 45281 | +module.exports = { | |
| 45282 | + getResponseData, | |
| 45283 | + getMockDispatch, | |
| 45284 | + addMockDispatch, | |
| 45285 | + deleteMockDispatch, | |
| 45286 | + buildKey, | |
| 45287 | + generateKeyValues, | |
| 45288 | + matchValue, | |
| 45289 | + getResponse, | |
| 45290 | + getStatusText, | |
| 45291 | + mockDispatch, | |
| 45292 | + buildMockDispatch, | |
| 45293 | + checkNetConnect, | |
| 45294 | + buildMockOptions, | |
| 45295 | + getHeaderByName | |
| 45296 | +} | |
| 45297 | + | |
| 45298 | + | |
| 45299 | +/***/ }), | |
| 45300 | + | |
| 45301 | +/***/ 6142: | |
| 45302 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 45303 | + | |
| 45304 | +"use strict"; | |
| 45305 | + | |
| 45306 | + | |
| 45307 | +const { Transform } = __nccwpck_require__(2203) | |
| 45308 | +const { Console } = __nccwpck_require__(4236) | |
| 45309 | + | |
| 45310 | +/** | |
| 45311 | + * Gets the output of `console.table(…)` as a string. | |
| 45312 | + */ | |
| 45313 | +module.exports = class PendingInterceptorsFormatter { | |
| 45314 | + constructor ({ disableColors } = {}) { | |
| 45315 | + this.transform = new Transform({ | |
| 45316 | + transform (chunk, _enc, cb) { | |
| 45317 | + cb(null, chunk) | |
| 45318 | + } | |
| 45319 | + }) | |
| 45320 | + | |
| 45321 | + this.logger = new Console({ | |
| 45322 | + stdout: this.transform, | |
| 45323 | + inspectOptions: { | |
| 45324 | + colors: !disableColors && !process.env.CI | |
| 45325 | + } | |
| 45326 | + }) | |
| 45327 | + } | |
| 45328 | + | |
| 45329 | + format (pendingInterceptors) { | |
| 45330 | + const withPrettyHeaders = pendingInterceptors.map( | |
| 45331 | + ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ | |
| 45332 | + Method: method, | |
| 45333 | + Origin: origin, | |
| 45334 | + Path: path, | |
| 45335 | + 'Status code': statusCode, | |
| 45336 | + Persistent: persist ? '✅' : '❌', | |
| 45337 | + Invocations: timesInvoked, | |
| 45338 | + Remaining: persist ? Infinity : times - timesInvoked | |
| 45339 | + })) | |
| 45340 | + | |
| 45341 | + this.logger.table(withPrettyHeaders) | |
| 45342 | + return this.transform.read().toString() | |
| 45343 | + } | |
| 45344 | +} | |
| 45345 | + | |
| 45346 | + | |
| 45347 | +/***/ }), | |
| 45348 | + | |
| 45349 | +/***/ 1529: | |
| 45350 | +/***/ ((module) => { | |
| 45351 | + | |
| 45352 | +"use strict"; | |
| 45353 | + | |
| 45354 | + | |
| 45355 | +const singulars = { | |
| 45356 | + pronoun: 'it', | |
| 45357 | + is: 'is', | |
| 45358 | + was: 'was', | |
| 45359 | + this: 'this' | |
| 45360 | +} | |
| 45361 | + | |
| 45362 | +const plurals = { | |
| 45363 | + pronoun: 'they', | |
| 45364 | + is: 'are', | |
| 45365 | + was: 'were', | |
| 45366 | + this: 'these' | |
| 45367 | +} | |
| 45368 | + | |
| 45369 | +module.exports = class Pluralizer { | |
| 45370 | + constructor (singular, plural) { | |
| 45371 | + this.singular = singular | |
| 45372 | + this.plural = plural | |
| 45373 | + } | |
| 45374 | + | |
| 45375 | + pluralize (count) { | |
| 45376 | + const one = count === 1 | |
| 45377 | + const keys = one ? singulars : plurals | |
| 45378 | + const noun = one ? this.singular : this.plural | |
| 45379 | + return { ...keys, count, noun } | |
| 45380 | + } | |
| 45381 | +} | |
| 45382 | + | |
| 45383 | + | |
| 45384 | +/***/ }), | |
| 45385 | + | |
| 45386 | +/***/ 4869: | |
| 45387 | +/***/ ((module) => { | |
| 45388 | + | |
| 45389 | +"use strict"; | |
| 45390 | +/* eslint-disable */ | |
| 45391 | + | |
| 45392 | + | |
| 45393 | + | |
| 45394 | +// Extracted from node/lib/internal/fixed_queue.js | |
| 45395 | + | |
| 45396 | +// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. | |
| 45397 | +const kSize = 2048; | |
| 45398 | +const kMask = kSize - 1; | |
| 45399 | + | |
| 45400 | +// The FixedQueue is implemented as a singly-linked list of fixed-size | |
| 45401 | +// circular buffers. It looks something like this: | |
| 45402 | +// | |
| 45403 | +// head tail | |
| 45404 | +// | | | |
| 45405 | +// v v | |
| 45406 | +// +-----------+ <-----\ +-----------+ <------\ +-----------+ | |
| 45407 | +// | [null] | \----- | next | \------- | next | | |
| 45408 | +// +-----------+ +-----------+ +-----------+ | |
| 45409 | +// | item | <-- bottom | item | <-- bottom | [empty] | | |
| 45410 | +// | item | | item | | [empty] | | |
| 45411 | +// | item | | item | | [empty] | | |
| 45412 | +// | item | | item | | [empty] | | |
| 45413 | +// | item | | item | bottom --> | item | | |
| 45414 | +// | item | | item | | item | | |
| 45415 | +// | ... | | ... | | ... | | |
| 45416 | +// | item | | item | | item | | |
| 45417 | +// | item | | item | | item | | |
| 45418 | +// | [empty] | <-- top | item | | item | | |
| 45419 | +// | [empty] | | item | | item | | |
| 45420 | +// | [empty] | | [empty] | <-- top top --> | [empty] | | |
| 45421 | +// +-----------+ +-----------+ +-----------+ | |
| 45422 | +// | |
| 45423 | +// Or, if there is only one circular buffer, it looks something | |
| 45424 | +// like either of these: | |
| 45425 | +// | |
| 45426 | +// head tail head tail | |
| 45427 | +// | | | | | |
| 45428 | +// v v v v | |
| 45429 | +// +-----------+ +-----------+ | |
| 45430 | +// | [null] | | [null] | | |
| 45431 | +// +-----------+ +-----------+ | |
| 45432 | +// | [empty] | | item | | |
| 45433 | +// | [empty] | | item | | |
| 45434 | +// | item | <-- bottom top --> | [empty] | | |
| 45435 | +// | item | | [empty] | | |
| 45436 | +// | [empty] | <-- top bottom --> | item | | |
| 45437 | +// | [empty] | | item | | |
| 45438 | +// +-----------+ +-----------+ | |
| 45439 | +// | |
| 45440 | +// Adding a value means moving `top` forward by one, removing means | |
| 45441 | +// moving `bottom` forward by one. After reaching the end, the queue | |
| 45442 | +// wraps around. | |
| 45443 | +// | |
| 45444 | +// When `top === bottom` the current queue is empty and when | |
| 45445 | +// `top + 1 === bottom` it's full. This wastes a single space of storage | |
| 45446 | +// but allows much quicker checks. | |
| 45447 | + | |
| 45448 | +class FixedCircularBuffer { | |
| 45449 | + constructor() { | |
| 45450 | + this.bottom = 0; | |
| 45451 | + this.top = 0; | |
| 45452 | + this.list = new Array(kSize); | |
| 45453 | + this.next = null; | |
| 45454 | + } | |
| 45455 | + | |
| 45456 | + isEmpty() { | |
| 45457 | + return this.top === this.bottom; | |
| 45458 | + } | |
| 45459 | + | |
| 45460 | + isFull() { | |
| 45461 | + return ((this.top + 1) & kMask) === this.bottom; | |
| 45462 | + } | |
| 45463 | + | |
| 45464 | + push(data) { | |
| 45465 | + this.list[this.top] = data; | |
| 45466 | + this.top = (this.top + 1) & kMask; | |
| 45467 | + } | |
| 45468 | + | |
| 45469 | + shift() { | |
| 45470 | + const nextItem = this.list[this.bottom]; | |
| 45471 | + if (nextItem === undefined) | |
| 45472 | + return null; | |
| 45473 | + this.list[this.bottom] = undefined; | |
| 45474 | + this.bottom = (this.bottom + 1) & kMask; | |
| 45475 | + return nextItem; | |
| 45476 | + } | |
| 45477 | +} | |
| 45478 | + | |
| 45479 | +module.exports = class FixedQueue { | |
| 45480 | + constructor() { | |
| 45481 | + this.head = this.tail = new FixedCircularBuffer(); | |
| 45482 | + } | |
| 45483 | + | |
| 45484 | + isEmpty() { | |
| 45485 | + return this.head.isEmpty(); | |
| 45486 | + } | |
| 45487 | + | |
| 45488 | + push(data) { | |
| 45489 | + if (this.head.isFull()) { | |
| 45490 | + // Head is full: Creates a new queue, sets the old queue's `.next` to it, | |
| 45491 | + // and sets it as the new main queue. | |
| 45492 | + this.head = this.head.next = new FixedCircularBuffer(); | |
| 45493 | + } | |
| 45494 | + this.head.push(data); | |
| 45495 | + } | |
| 45496 | + | |
| 45497 | + shift() { | |
| 45498 | + const tail = this.tail; | |
| 45499 | + const next = tail.shift(); | |
| 45500 | + if (tail.isEmpty() && tail.next !== null) { | |
| 45501 | + // If there is another queue, it forms the new tail. | |
| 45502 | + this.tail = tail.next; | |
| 45503 | + } | |
| 45504 | + return next; | |
| 45505 | + } | |
| 45506 | +}; | |
| 45507 | + | |
| 45508 | + | |
| 45509 | +/***/ }), | |
| 45510 | + | |
| 45511 | +/***/ 8640: | |
| 45512 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 45513 | + | |
| 45514 | +"use strict"; | |
| 45515 | + | |
| 45516 | + | |
| 45517 | +const DispatcherBase = __nccwpck_require__(1) | |
| 45518 | +const FixedQueue = __nccwpck_require__(4869) | |
| 45519 | +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(6443) | |
| 45520 | +const PoolStats = __nccwpck_require__(4622) | |
| 45521 | + | |
| 45522 | +const kClients = Symbol('clients') | |
| 45523 | +const kNeedDrain = Symbol('needDrain') | |
| 45524 | +const kQueue = Symbol('queue') | |
| 45525 | +const kClosedResolve = Symbol('closed resolve') | |
| 45526 | +const kOnDrain = Symbol('onDrain') | |
| 45527 | +const kOnConnect = Symbol('onConnect') | |
| 45528 | +const kOnDisconnect = Symbol('onDisconnect') | |
| 45529 | +const kOnConnectionError = Symbol('onConnectionError') | |
| 45530 | +const kGetDispatcher = Symbol('get dispatcher') | |
| 45531 | +const kAddClient = Symbol('add client') | |
| 45532 | +const kRemoveClient = Symbol('remove client') | |
| 45533 | +const kStats = Symbol('stats') | |
| 45534 | + | |
| 45535 | +class PoolBase extends DispatcherBase { | |
| 45536 | + constructor () { | |
| 45537 | + super() | |
| 45538 | + | |
| 45539 | + this[kQueue] = new FixedQueue() | |
| 45540 | + this[kClients] = [] | |
| 45541 | + this[kQueued] = 0 | |
| 45542 | + | |
| 45543 | + const pool = this | |
| 45544 | + | |
| 45545 | + this[kOnDrain] = function onDrain (origin, targets) { | |
| 45546 | + const queue = pool[kQueue] | |
| 45547 | + | |
| 45548 | + let needDrain = false | |
| 45549 | + | |
| 45550 | + while (!needDrain) { | |
| 45551 | + const item = queue.shift() | |
| 45552 | + if (!item) { | |
| 45553 | + break | |
| 45554 | + } | |
| 45555 | + pool[kQueued]-- | |
| 45556 | + needDrain = !this.dispatch(item.opts, item.handler) | |
| 45557 | + } | |
| 45558 | + | |
| 45559 | + this[kNeedDrain] = needDrain | |
| 45560 | + | |
| 45561 | + if (!this[kNeedDrain] && pool[kNeedDrain]) { | |
| 45562 | + pool[kNeedDrain] = false | |
| 45563 | + pool.emit('drain', origin, [pool, ...targets]) | |
| 45564 | + } | |
| 45565 | + | |
| 45566 | + if (pool[kClosedResolve] && queue.isEmpty()) { | |
| 45567 | + Promise | |
| 45568 | + .all(pool[kClients].map(c => c.close())) | |
| 45569 | + .then(pool[kClosedResolve]) | |
| 45570 | + } | |
| 45571 | + } | |
| 45572 | + | |
| 45573 | + this[kOnConnect] = (origin, targets) => { | |
| 45574 | + pool.emit('connect', origin, [pool, ...targets]) | |
| 45575 | + } | |
| 45576 | + | |
| 45577 | + this[kOnDisconnect] = (origin, targets, err) => { | |
| 45578 | + pool.emit('disconnect', origin, [pool, ...targets], err) | |
| 45579 | + } | |
| 45580 | + | |
| 45581 | + this[kOnConnectionError] = (origin, targets, err) => { | |
| 45582 | + pool.emit('connectionError', origin, [pool, ...targets], err) | |
| 45583 | + } | |
| 45584 | + | |
| 45585 | + this[kStats] = new PoolStats(this) | |
| 45586 | + } | |
| 45587 | + | |
| 45588 | + get [kBusy] () { | |
| 45589 | + return this[kNeedDrain] | |
| 45590 | + } | |
| 45591 | + | |
| 45592 | + get [kConnected] () { | |
| 45593 | + return this[kClients].filter(client => client[kConnected]).length | |
| 45594 | + } | |
| 45595 | + | |
| 45596 | + get [kFree] () { | |
| 45597 | + return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length | |
| 45598 | + } | |
| 45599 | + | |
| 45600 | + get [kPending] () { | |
| 45601 | + let ret = this[kQueued] | |
| 45602 | + for (const { [kPending]: pending } of this[kClients]) { | |
| 45603 | + ret += pending | |
| 45604 | + } | |
| 45605 | + return ret | |
| 45606 | + } | |
| 45607 | + | |
| 45608 | + get [kRunning] () { | |
| 45609 | + let ret = 0 | |
| 45610 | + for (const { [kRunning]: running } of this[kClients]) { | |
| 45611 | + ret += running | |
| 45612 | + } | |
| 45613 | + return ret | |
| 45614 | + } | |
| 45615 | + | |
| 45616 | + get [kSize] () { | |
| 45617 | + let ret = this[kQueued] | |
| 45618 | + for (const { [kSize]: size } of this[kClients]) { | |
| 45619 | + ret += size | |
| 45620 | + } | |
| 45621 | + return ret | |
| 45622 | + } | |
| 45623 | + | |
| 45624 | + get stats () { | |
| 45625 | + return this[kStats] | |
| 45626 | + } | |
| 45627 | + | |
| 45628 | + async [kClose] () { | |
| 45629 | + if (this[kQueue].isEmpty()) { | |
| 45630 | + return Promise.all(this[kClients].map(c => c.close())) | |
| 45631 | + } else { | |
| 45632 | + return new Promise((resolve) => { | |
| 45633 | + this[kClosedResolve] = resolve | |
| 45634 | + }) | |
| 45635 | + } | |
| 45636 | + } | |
| 45637 | + | |
| 45638 | + async [kDestroy] (err) { | |
| 45639 | + while (true) { | |
| 45640 | + const item = this[kQueue].shift() | |
| 45641 | + if (!item) { | |
| 45642 | + break | |
| 45643 | + } | |
| 45644 | + item.handler.onError(err) | |
| 45645 | + } | |
| 45646 | + | |
| 45647 | + return Promise.all(this[kClients].map(c => c.destroy(err))) | |
| 45648 | + } | |
| 45649 | + | |
| 45650 | + [kDispatch] (opts, handler) { | |
| 45651 | + const dispatcher = this[kGetDispatcher]() | |
| 45652 | + | |
| 45653 | + if (!dispatcher) { | |
| 45654 | + this[kNeedDrain] = true | |
| 45655 | + this[kQueue].push({ opts, handler }) | |
| 45656 | + this[kQueued]++ | |
| 45657 | + } else if (!dispatcher.dispatch(opts, handler)) { | |
| 45658 | + dispatcher[kNeedDrain] = true | |
| 45659 | + this[kNeedDrain] = !this[kGetDispatcher]() | |
| 45660 | + } | |
| 45661 | + | |
| 45662 | + return !this[kNeedDrain] | |
| 45663 | + } | |
| 45664 | + | |
| 45665 | + [kAddClient] (client) { | |
| 45666 | + client | |
| 45667 | + .on('drain', this[kOnDrain]) | |
| 45668 | + .on('connect', this[kOnConnect]) | |
| 45669 | + .on('disconnect', this[kOnDisconnect]) | |
| 45670 | + .on('connectionError', this[kOnConnectionError]) | |
| 45671 | + | |
| 45672 | + this[kClients].push(client) | |
| 45673 | + | |
| 45674 | + if (this[kNeedDrain]) { | |
| 45675 | + process.nextTick(() => { | |
| 45676 | + if (this[kNeedDrain]) { | |
| 45677 | + this[kOnDrain](client[kUrl], [this, client]) | |
| 45678 | + } | |
| 45679 | + }) | |
| 45680 | + } | |
| 45681 | + | |
| 45682 | + return this | |
| 45683 | + } | |
| 45684 | + | |
| 45685 | + [kRemoveClient] (client) { | |
| 45686 | + client.close(() => { | |
| 45687 | + const idx = this[kClients].indexOf(client) | |
| 45688 | + if (idx !== -1) { | |
| 45689 | + this[kClients].splice(idx, 1) | |
| 45690 | + } | |
| 45691 | + }) | |
| 45692 | + | |
| 45693 | + this[kNeedDrain] = this[kClients].some(dispatcher => ( | |
| 45694 | + !dispatcher[kNeedDrain] && | |
| 45695 | + dispatcher.closed !== true && | |
| 45696 | + dispatcher.destroyed !== true | |
| 45697 | + )) | |
| 45698 | + } | |
| 45699 | +} | |
| 45700 | + | |
| 45701 | +module.exports = { | |
| 45702 | + PoolBase, | |
| 45703 | + kClients, | |
| 45704 | + kNeedDrain, | |
| 45705 | + kAddClient, | |
| 45706 | + kRemoveClient, | |
| 45707 | + kGetDispatcher | |
| 45708 | +} | |
| 45709 | + | |
| 45710 | + | |
| 45711 | +/***/ }), | |
| 45712 | + | |
| 45713 | +/***/ 4622: | |
| 45714 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 45715 | + | |
| 45716 | +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(6443) | |
| 45717 | +const kPool = Symbol('pool') | |
| 45718 | + | |
| 45719 | +class PoolStats { | |
| 45720 | + constructor (pool) { | |
| 45721 | + this[kPool] = pool | |
| 45722 | + } | |
| 45723 | + | |
| 45724 | + get connected () { | |
| 45725 | + return this[kPool][kConnected] | |
| 45726 | + } | |
| 45727 | + | |
| 45728 | + get free () { | |
| 45729 | + return this[kPool][kFree] | |
| 45730 | + } | |
| 45731 | + | |
| 45732 | + get pending () { | |
| 45733 | + return this[kPool][kPending] | |
| 45734 | + } | |
| 45735 | + | |
| 45736 | + get queued () { | |
| 45737 | + return this[kPool][kQueued] | |
| 45738 | + } | |
| 45739 | + | |
| 45740 | + get running () { | |
| 45741 | + return this[kPool][kRunning] | |
| 45742 | + } | |
| 45743 | + | |
| 45744 | + get size () { | |
| 45745 | + return this[kPool][kSize] | |
| 45746 | + } | |
| 45747 | +} | |
| 45748 | + | |
| 45749 | +module.exports = PoolStats | |
| 45750 | + | |
| 45751 | + | |
| 45752 | +/***/ }), | |
| 45753 | + | |
| 45754 | +/***/ 5076: | |
| 45755 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 45756 | + | |
| 45757 | +"use strict"; | |
| 45758 | + | |
| 45759 | + | |
| 45760 | +const { | |
| 45761 | + PoolBase, | |
| 45762 | + kClients, | |
| 45763 | + kNeedDrain, | |
| 45764 | + kAddClient, | |
| 45765 | + kGetDispatcher | |
| 45766 | +} = __nccwpck_require__(8640) | |
| 45767 | +const Client = __nccwpck_require__(6197) | |
| 45768 | +const { | |
| 45769 | + InvalidArgumentError | |
| 45770 | +} = __nccwpck_require__(8707) | |
| 45771 | +const util = __nccwpck_require__(3440) | |
| 45772 | +const { kUrl, kInterceptors } = __nccwpck_require__(6443) | |
| 45773 | +const buildConnector = __nccwpck_require__(9136) | |
| 45774 | + | |
| 45775 | +const kOptions = Symbol('options') | |
| 45776 | +const kConnections = Symbol('connections') | |
| 45777 | +const kFactory = Symbol('factory') | |
| 45778 | + | |
| 45779 | +function defaultFactory (origin, opts) { | |
| 45780 | + return new Client(origin, opts) | |
| 45781 | +} | |
| 45782 | + | |
| 45783 | +class Pool extends PoolBase { | |
| 45784 | + constructor (origin, { | |
| 45785 | + connections, | |
| 45786 | + factory = defaultFactory, | |
| 45787 | + connect, | |
| 45788 | + connectTimeout, | |
| 45789 | + tls, | |
| 45790 | + maxCachedSessions, | |
| 45791 | + socketPath, | |
| 45792 | + autoSelectFamily, | |
| 45793 | + autoSelectFamilyAttemptTimeout, | |
| 45794 | + allowH2, | |
| 45795 | + ...options | |
| 45796 | + } = {}) { | |
| 45797 | + super() | |
| 45798 | + | |
| 45799 | + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { | |
| 45800 | + throw new InvalidArgumentError('invalid connections') | |
| 45801 | + } | |
| 45802 | + | |
| 45803 | + if (typeof factory !== 'function') { | |
| 45804 | + throw new InvalidArgumentError('factory must be a function.') | |
| 45805 | + } | |
| 45806 | + | |
| 45807 | + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { | |
| 45808 | + throw new InvalidArgumentError('connect must be a function or an object') | |
| 45809 | + } | |
| 45810 | + | |
| 45811 | + if (typeof connect !== 'function') { | |
| 45812 | + connect = buildConnector({ | |
| 45813 | + ...tls, | |
| 45814 | + maxCachedSessions, | |
| 45815 | + allowH2, | |
| 45816 | + socketPath, | |
| 45817 | + timeout: connectTimeout, | |
| 45818 | + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), | |
| 45819 | + ...connect | |
| 45820 | + }) | |
| 45821 | + } | |
| 45822 | + | |
| 45823 | + this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) | |
| 45824 | + ? options.interceptors.Pool | |
| 45825 | + : [] | |
| 45826 | + this[kConnections] = connections || null | |
| 45827 | + this[kUrl] = util.parseOrigin(origin) | |
| 45828 | + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } | |
| 45829 | + this[kOptions].interceptors = options.interceptors | |
| 45830 | + ? { ...options.interceptors } | |
| 45831 | + : undefined | |
| 45832 | + this[kFactory] = factory | |
| 45833 | + | |
| 45834 | + this.on('connectionError', (origin, targets, error) => { | |
| 45835 | + // If a connection error occurs, we remove the client from the pool, | |
| 45836 | + // and emit a connectionError event. They will not be re-used. | |
| 45837 | + // Fixes https://github.com/nodejs/undici/issues/3895 | |
| 45838 | + for (const target of targets) { | |
| 45839 | + // Do not use kRemoveClient here, as it will close the client, | |
| 45840 | + // but the client cannot be closed in this state. | |
| 45841 | + const idx = this[kClients].indexOf(target) | |
| 45842 | + if (idx !== -1) { | |
| 45843 | + this[kClients].splice(idx, 1) | |
| 45844 | + } | |
| 45845 | + } | |
| 45846 | + }) | |
| 45847 | + } | |
| 45848 | + | |
| 45849 | + [kGetDispatcher] () { | |
| 45850 | + let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) | |
| 45851 | + | |
| 45852 | + if (dispatcher) { | |
| 45853 | + return dispatcher | |
| 45854 | + } | |
| 45855 | + | |
| 45856 | + if (!this[kConnections] || this[kClients].length < this[kConnections]) { | |
| 45857 | + dispatcher = this[kFactory](this[kUrl], this[kOptions]) | |
| 45858 | + this[kAddClient](dispatcher) | |
| 45859 | + } | |
| 45860 | + | |
| 45861 | + return dispatcher | |
| 45862 | + } | |
| 45863 | +} | |
| 45864 | + | |
| 45865 | +module.exports = Pool | |
| 45866 | + | |
| 45867 | + | |
| 45868 | +/***/ }), | |
| 45869 | + | |
| 45870 | +/***/ 2720: | |
| 45871 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 45872 | + | |
| 45873 | +"use strict"; | |
| 45874 | + | |
| 45875 | + | |
| 45876 | +const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(6443) | |
| 45877 | +const { URL } = __nccwpck_require__(7016) | |
| 45878 | +const Agent = __nccwpck_require__(9965) | |
| 45879 | +const Pool = __nccwpck_require__(5076) | |
| 45880 | +const DispatcherBase = __nccwpck_require__(1) | |
| 45881 | +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707) | |
| 45882 | +const buildConnector = __nccwpck_require__(9136) | |
| 45883 | + | |
| 45884 | +const kAgent = Symbol('proxy agent') | |
| 45885 | +const kClient = Symbol('proxy client') | |
| 45886 | +const kProxyHeaders = Symbol('proxy headers') | |
| 45887 | +const kRequestTls = Symbol('request tls settings') | |
| 45888 | +const kProxyTls = Symbol('proxy tls settings') | |
| 45889 | +const kConnectEndpoint = Symbol('connect endpoint function') | |
| 45890 | + | |
| 45891 | +function defaultProtocolPort (protocol) { | |
| 45892 | + return protocol === 'https:' ? 443 : 80 | |
| 45893 | +} | |
| 45894 | + | |
| 45895 | +function buildProxyOptions (opts) { | |
| 45896 | + if (typeof opts === 'string') { | |
| 45897 | + opts = { uri: opts } | |
| 45898 | + } | |
| 45899 | + | |
| 45900 | + if (!opts || !opts.uri) { | |
| 45901 | + throw new InvalidArgumentError('Proxy opts.uri is mandatory') | |
| 45902 | + } | |
| 45903 | + | |
| 45904 | + return { | |
| 45905 | + uri: opts.uri, | |
| 45906 | + protocol: opts.protocol || 'https' | |
| 45907 | + } | |
| 45908 | +} | |
| 45909 | + | |
| 45910 | +function defaultFactory (origin, opts) { | |
| 45911 | + return new Pool(origin, opts) | |
| 45912 | +} | |
| 45913 | + | |
| 45914 | +class ProxyAgent extends DispatcherBase { | |
| 45915 | + constructor (opts) { | |
| 45916 | + super(opts) | |
| 45917 | + this[kProxy] = buildProxyOptions(opts) | |
| 45918 | + this[kAgent] = new Agent(opts) | |
| 45919 | + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) | |
| 45920 | + ? opts.interceptors.ProxyAgent | |
| 45921 | + : [] | |
| 45922 | + | |
| 45923 | + if (typeof opts === 'string') { | |
| 45924 | + opts = { uri: opts } | |
| 45925 | + } | |
| 45926 | + | |
| 45927 | + if (!opts || !opts.uri) { | |
| 45928 | + throw new InvalidArgumentError('Proxy opts.uri is mandatory') | |
| 45929 | + } | |
| 45930 | + | |
| 45931 | + const { clientFactory = defaultFactory } = opts | |
| 45932 | + | |
| 45933 | + if (typeof clientFactory !== 'function') { | |
| 45934 | + throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') | |
| 45935 | + } | |
| 45936 | + | |
| 45937 | + this[kRequestTls] = opts.requestTls | |
| 45938 | + this[kProxyTls] = opts.proxyTls | |
| 45939 | + this[kProxyHeaders] = opts.headers || {} | |
| 45940 | + | |
| 45941 | + const resolvedUrl = new URL(opts.uri) | |
| 45942 | + const { origin, port, host, username, password } = resolvedUrl | |
| 45943 | + | |
| 45944 | + if (opts.auth && opts.token) { | |
| 45945 | + throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') | |
| 45946 | + } else if (opts.auth) { | |
| 45947 | + /* @deprecated in favour of opts.token */ | |
| 45948 | + this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` | |
| 45949 | + } else if (opts.token) { | |
| 45950 | + this[kProxyHeaders]['proxy-authorization'] = opts.token | |
| 45951 | + } else if (username && password) { | |
| 45952 | + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` | |
| 45953 | + } | |
| 45954 | + | |
| 45955 | + const connect = buildConnector({ ...opts.proxyTls }) | |
| 45956 | + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) | |
| 45957 | + this[kClient] = clientFactory(resolvedUrl, { connect }) | |
| 45958 | + this[kAgent] = new Agent({ | |
| 45959 | + ...opts, | |
| 45960 | + connect: async (opts, callback) => { | |
| 45961 | + let requestedHost = opts.host | |
| 45962 | + if (!opts.port) { | |
| 45963 | + requestedHost += `:${defaultProtocolPort(opts.protocol)}` | |
| 45964 | + } | |
| 45965 | + try { | |
| 45966 | + const { socket, statusCode } = await this[kClient].connect({ | |
| 45967 | + origin, | |
| 45968 | + port, | |
| 45969 | + path: requestedHost, | |
| 45970 | + signal: opts.signal, | |
| 45971 | + headers: { | |
| 45972 | + ...this[kProxyHeaders], | |
| 45973 | + host | |
| 45974 | + } | |
| 45975 | + }) | |
| 45976 | + if (statusCode !== 200) { | |
| 45977 | + socket.on('error', () => {}).destroy() | |
| 45978 | + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) | |
| 45979 | + } | |
| 45980 | + if (opts.protocol !== 'https:') { | |
| 45981 | + callback(null, socket) | |
| 45982 | + return | |
| 45983 | + } | |
| 45984 | + let servername | |
| 45985 | + if (this[kRequestTls]) { | |
| 45986 | + servername = this[kRequestTls].servername | |
| 45987 | + } else { | |
| 45988 | + servername = opts.servername | |
| 45989 | + } | |
| 45990 | + this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) | |
| 45991 | + } catch (err) { | |
| 45992 | + callback(err) | |
| 45993 | + } | |
| 45994 | + } | |
| 45995 | + }) | |
| 45996 | + } | |
| 45997 | + | |
| 45998 | + dispatch (opts, handler) { | |
| 45999 | + const { host } = new URL(opts.origin) | |
| 46000 | + const headers = buildHeaders(opts.headers) | |
| 46001 | + throwIfProxyAuthIsSent(headers) | |
| 46002 | + return this[kAgent].dispatch( | |
| 46003 | + { | |
| 46004 | + ...opts, | |
| 46005 | + headers: { | |
| 46006 | + ...headers, | |
| 46007 | + host | |
| 46008 | + } | |
| 46009 | + }, | |
| 46010 | + handler | |
| 46011 | + ) | |
| 46012 | + } | |
| 46013 | + | |
| 46014 | + async [kClose] () { | |
| 46015 | + await this[kAgent].close() | |
| 46016 | + await this[kClient].close() | |
| 46017 | + } | |
| 46018 | + | |
| 46019 | + async [kDestroy] () { | |
| 46020 | + await this[kAgent].destroy() | |
| 46021 | + await this[kClient].destroy() | |
| 46022 | + } | |
| 46023 | +} | |
| 46024 | + | |
| 46025 | +/** | |
| 46026 | + * @param {string[] | Record<string, string>} headers | |
| 46027 | + * @returns {Record<string, string>} | |
| 46028 | + */ | |
| 46029 | +function buildHeaders (headers) { | |
| 46030 | + // When using undici.fetch, the headers list is stored | |
| 46031 | + // as an array. | |
| 46032 | + if (Array.isArray(headers)) { | |
| 46033 | + /** @type {Record<string, string>} */ | |
| 46034 | + const headersPair = {} | |
| 46035 | + | |
| 46036 | + for (let i = 0; i < headers.length; i += 2) { | |
| 46037 | + headersPair[headers[i]] = headers[i + 1] | |
| 46038 | + } | |
| 46039 | + | |
| 46040 | + return headersPair | |
| 46041 | + } | |
| 46042 | + | |
| 46043 | + return headers | |
| 46044 | +} | |
| 46045 | + | |
| 46046 | +/** | |
| 46047 | + * @param {Record<string, string>} headers | |
| 46048 | + * | |
| 46049 | + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers | |
| 46050 | + * Nevertheless, it was changed and to avoid a security vulnerability by end users | |
| 46051 | + * this check was created. | |
| 46052 | + * It should be removed in the next major version for performance reasons | |
| 46053 | + */ | |
| 46054 | +function throwIfProxyAuthIsSent (headers) { | |
| 46055 | + const existProxyAuth = headers && Object.keys(headers) | |
| 46056 | + .find((key) => key.toLowerCase() === 'proxy-authorization') | |
| 46057 | + if (existProxyAuth) { | |
| 46058 | + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') | |
| 46059 | + } | |
| 46060 | +} | |
| 46061 | + | |
| 46062 | +module.exports = ProxyAgent | |
| 46063 | + | |
| 46064 | + | |
| 46065 | +/***/ }), | |
| 46066 | + | |
| 46067 | +/***/ 8804: | |
| 46068 | +/***/ ((module) => { | |
| 46069 | + | |
| 46070 | +"use strict"; | |
| 46071 | + | |
| 46072 | + | |
| 46073 | +let fastNow = Date.now() | |
| 46074 | +let fastNowTimeout | |
| 46075 | + | |
| 46076 | +const fastTimers = [] | |
| 46077 | + | |
| 46078 | +function onTimeout () { | |
| 46079 | + fastNow = Date.now() | |
| 46080 | + | |
| 46081 | + let len = fastTimers.length | |
| 46082 | + let idx = 0 | |
| 46083 | + while (idx < len) { | |
| 46084 | + const timer = fastTimers[idx] | |
| 46085 | + | |
| 46086 | + if (timer.state === 0) { | |
| 46087 | + timer.state = fastNow + timer.delay | |
| 46088 | + } else if (timer.state > 0 && fastNow >= timer.state) { | |
| 46089 | + timer.state = -1 | |
| 46090 | + timer.callback(timer.opaque) | |
| 46091 | + } | |
| 46092 | + | |
| 46093 | + if (timer.state === -1) { | |
| 46094 | + timer.state = -2 | |
| 46095 | + if (idx !== len - 1) { | |
| 46096 | + fastTimers[idx] = fastTimers.pop() | |
| 46097 | + } else { | |
| 46098 | + fastTimers.pop() | |
| 46099 | + } | |
| 46100 | + len -= 1 | |
| 46101 | + } else { | |
| 46102 | + idx += 1 | |
| 46103 | + } | |
| 46104 | + } | |
| 46105 | + | |
| 46106 | + if (fastTimers.length > 0) { | |
| 46107 | + refreshTimeout() | |
| 46108 | + } | |
| 46109 | +} | |
| 46110 | + | |
| 46111 | +function refreshTimeout () { | |
| 46112 | + if (fastNowTimeout && fastNowTimeout.refresh) { | |
| 46113 | + fastNowTimeout.refresh() | |
| 46114 | + } else { | |
| 46115 | + clearTimeout(fastNowTimeout) | |
| 46116 | + fastNowTimeout = setTimeout(onTimeout, 1e3) | |
| 46117 | + if (fastNowTimeout.unref) { | |
| 46118 | + fastNowTimeout.unref() | |
| 46119 | + } | |
| 46120 | + } | |
| 46121 | +} | |
| 46122 | + | |
| 46123 | +class Timeout { | |
| 46124 | + constructor (callback, delay, opaque) { | |
| 46125 | + this.callback = callback | |
| 46126 | + this.delay = delay | |
| 46127 | + this.opaque = opaque | |
| 46128 | + | |
| 46129 | + // -2 not in timer list | |
| 46130 | + // -1 in timer list but inactive | |
| 46131 | + // 0 in timer list waiting for time | |
| 46132 | + // > 0 in timer list waiting for time to expire | |
| 46133 | + this.state = -2 | |
| 46134 | + | |
| 46135 | + this.refresh() | |
| 46136 | + } | |
| 46137 | + | |
| 46138 | + refresh () { | |
| 46139 | + if (this.state === -2) { | |
| 46140 | + fastTimers.push(this) | |
| 46141 | + if (!fastNowTimeout || fastTimers.length === 1) { | |
| 46142 | + refreshTimeout() | |
| 46143 | + } | |
| 46144 | + } | |
| 46145 | + | |
| 46146 | + this.state = 0 | |
| 46147 | + } | |
| 46148 | + | |
| 46149 | + clear () { | |
| 46150 | + this.state = -1 | |
| 46151 | + } | |
| 46152 | +} | |
| 46153 | + | |
| 46154 | +module.exports = { | |
| 46155 | + setTimeout (callback, delay, opaque) { | |
| 46156 | + return delay < 1e3 | |
| 46157 | + ? setTimeout(callback, delay, opaque) | |
| 46158 | + : new Timeout(callback, delay, opaque) | |
| 46159 | + }, | |
| 46160 | + clearTimeout (timeout) { | |
| 46161 | + if (timeout instanceof Timeout) { | |
| 46162 | + timeout.clear() | |
| 46163 | + } else { | |
| 46164 | + clearTimeout(timeout) | |
| 46165 | + } | |
| 46166 | + } | |
| 46167 | +} | |
| 46168 | + | |
| 46169 | + | |
| 46170 | +/***/ }), | |
| 46171 | + | |
| 46172 | +/***/ 8550: | |
| 46173 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 46174 | + | |
| 46175 | +"use strict"; | |
| 46176 | + | |
| 46177 | + | |
| 46178 | +const diagnosticsChannel = __nccwpck_require__(1637) | |
| 46179 | +const { uid, states } = __nccwpck_require__(5913) | |
| 46180 | +const { | |
| 46181 | + kReadyState, | |
| 46182 | + kSentClose, | |
| 46183 | + kByteParser, | |
| 46184 | + kReceivedClose | |
| 46185 | +} = __nccwpck_require__(2933) | |
| 46186 | +const { fireEvent, failWebsocketConnection } = __nccwpck_require__(3574) | |
| 46187 | +const { CloseEvent } = __nccwpck_require__(6255) | |
| 46188 | +const { makeRequest } = __nccwpck_require__(5194) | |
| 46189 | +const { fetching } = __nccwpck_require__(2315) | |
| 46190 | +const { Headers } = __nccwpck_require__(6349) | |
| 46191 | +const { getGlobalDispatcher } = __nccwpck_require__(2581) | |
| 46192 | +const { kHeadersList } = __nccwpck_require__(6443) | |
| 46193 | + | |
| 46194 | +const channels = {} | |
| 46195 | +channels.open = diagnosticsChannel.channel('undici:websocket:open') | |
| 46196 | +channels.close = diagnosticsChannel.channel('undici:websocket:close') | |
| 46197 | +channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') | |
| 46198 | + | |
| 46199 | +/** @type {import('crypto')} */ | |
| 46200 | +let crypto | |
| 46201 | +try { | |
| 46202 | + crypto = __nccwpck_require__(6982) | |
| 46203 | +} catch { | |
| 46204 | + | |
| 46205 | +} | |
| 46206 | + | |
| 46207 | +/** | |
| 46208 | + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish | |
| 46209 | + * @param {URL} url | |
| 46210 | + * @param {string|string[]} protocols | |
| 46211 | + * @param {import('./websocket').WebSocket} ws | |
| 46212 | + * @param {(response: any) => void} onEstablish | |
| 46213 | + * @param {Partial<import('../../types/websocket').WebSocketInit>} options | |
| 46214 | + */ | |
| 46215 | +function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { | |
| 46216 | + // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s | |
| 46217 | + // scheme is "ws", and to "https" otherwise. | |
| 46218 | + const requestURL = url | |
| 46219 | + | |
| 46220 | + requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' | |
| 46221 | + | |
| 46222 | + // 2. Let request be a new request, whose URL is requestURL, client is client, | |
| 46223 | + // service-workers mode is "none", referrer is "no-referrer", mode is | |
| 46224 | + // "websocket", credentials mode is "include", cache mode is "no-store" , | |
| 46225 | + // and redirect mode is "error". | |
| 46226 | + const request = makeRequest({ | |
| 46227 | + urlList: [requestURL], | |
| 46228 | + serviceWorkers: 'none', | |
| 46229 | + referrer: 'no-referrer', | |
| 46230 | + mode: 'websocket', | |
| 46231 | + credentials: 'include', | |
| 46232 | + cache: 'no-store', | |
| 46233 | + redirect: 'error' | |
| 46234 | + }) | |
| 46235 | + | |
| 46236 | + // Note: undici extension, allow setting custom headers. | |
| 46237 | + if (options.headers) { | |
| 46238 | + const headersList = new Headers(options.headers)[kHeadersList] | |
| 46239 | + | |
| 46240 | + request.headersList = headersList | |
| 46241 | + } | |
| 46242 | + | |
| 46243 | + // 3. Append (`Upgrade`, `websocket`) to request’s header list. | |
| 46244 | + // 4. Append (`Connection`, `Upgrade`) to request’s header list. | |
| 46245 | + // Note: both of these are handled by undici currently. | |
| 46246 | + // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 | |
| 46247 | + | |
| 46248 | + // 5. Let keyValue be a nonce consisting of a randomly selected | |
| 46249 | + // 16-byte value that has been forgiving-base64-encoded and | |
| 46250 | + // isomorphic encoded. | |
| 46251 | + const keyValue = crypto.randomBytes(16).toString('base64') | |
| 46252 | + | |
| 46253 | + // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s | |
| 46254 | + // header list. | |
| 46255 | + request.headersList.append('sec-websocket-key', keyValue) | |
| 46256 | + | |
| 46257 | + // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s | |
| 46258 | + // header list. | |
| 46259 | + request.headersList.append('sec-websocket-version', '13') | |
| 46260 | + | |
| 46261 | + // 8. For each protocol in protocols, combine | |
| 46262 | + // (`Sec-WebSocket-Protocol`, protocol) in request’s header | |
| 46263 | + // list. | |
| 46264 | + for (const protocol of protocols) { | |
| 46265 | + request.headersList.append('sec-websocket-protocol', protocol) | |
| 46266 | + } | |
| 46267 | + | |
| 46268 | + // 9. Let permessageDeflate be a user-agent defined | |
| 46269 | + // "permessage-deflate" extension header value. | |
| 46270 | + // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 | |
| 46271 | + // TODO: enable once permessage-deflate is supported | |
| 46272 | + const permessageDeflate = '' // 'permessage-deflate; 15' | |
| 46273 | + | |
| 46274 | + // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to | |
| 46275 | + // request’s header list. | |
| 46276 | + // request.headersList.append('sec-websocket-extensions', permessageDeflate) | |
| 46277 | + | |
| 46278 | + // 11. Fetch request with useParallelQueue set to true, and | |
| 46279 | + // processResponse given response being these steps: | |
| 46280 | + const controller = fetching({ | |
| 46281 | + request, | |
| 46282 | + useParallelQueue: true, | |
| 46283 | + dispatcher: options.dispatcher ?? getGlobalDispatcher(), | |
| 46284 | + processResponse (response) { | |
| 46285 | + // 1. If response is a network error or its status is not 101, | |
| 46286 | + // fail the WebSocket connection. | |
| 46287 | + if (response.type === 'error' || response.status !== 101) { | |
| 46288 | + failWebsocketConnection(ws, 'Received network error or non-101 status code.') | |
| 46289 | + return | |
| 46290 | + } | |
| 46291 | + | |
| 46292 | + // 2. If protocols is not the empty list and extracting header | |
| 46293 | + // list values given `Sec-WebSocket-Protocol` and response’s | |
| 46294 | + // header list results in null, failure, or the empty byte | |
| 46295 | + // sequence, then fail the WebSocket connection. | |
| 46296 | + if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { | |
| 46297 | + failWebsocketConnection(ws, 'Server did not respond with sent protocols.') | |
| 46298 | + return | |
| 46299 | + } | |
| 46300 | + | |
| 46301 | + // 3. Follow the requirements stated step 2 to step 6, inclusive, | |
| 46302 | + // of the last set of steps in section 4.1 of The WebSocket | |
| 46303 | + // Protocol to validate response. This either results in fail | |
| 46304 | + // the WebSocket connection or the WebSocket connection is | |
| 46305 | + // established. | |
| 46306 | + | |
| 46307 | + // 2. If the response lacks an |Upgrade| header field or the |Upgrade| | |
| 46308 | + // header field contains a value that is not an ASCII case- | |
| 46309 | + // insensitive match for the value "websocket", the client MUST | |
| 46310 | + // _Fail the WebSocket Connection_. | |
| 46311 | + if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { | |
| 46312 | + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') | |
| 46313 | + return | |
| 46314 | + } | |
| 46315 | + | |
| 46316 | + // 3. If the response lacks a |Connection| header field or the | |
| 46317 | + // |Connection| header field doesn't contain a token that is an | |
| 46318 | + // ASCII case-insensitive match for the value "Upgrade", the client | |
| 46319 | + // MUST _Fail the WebSocket Connection_. | |
| 46320 | + if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { | |
| 46321 | + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') | |
| 46322 | + return | |
| 46323 | + } | |
| 46324 | + | |
| 46325 | + // 4. If the response lacks a |Sec-WebSocket-Accept| header field or | |
| 46326 | + // the |Sec-WebSocket-Accept| contains a value other than the | |
| 46327 | + // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- | |
| 46328 | + // Key| (as a string, not base64-decoded) with the string "258EAFA5- | |
| 46329 | + // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and | |
| 46330 | + // trailing whitespace, the client MUST _Fail the WebSocket | |
| 46331 | + // Connection_. | |
| 46332 | + const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') | |
| 46333 | + const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') | |
| 46334 | + if (secWSAccept !== digest) { | |
| 46335 | + failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') | |
| 46336 | + return | |
| 46337 | + } | |
| 46338 | + | |
| 46339 | + // 5. If the response includes a |Sec-WebSocket-Extensions| header | |
| 46340 | + // field and this header field indicates the use of an extension | |
| 46341 | + // that was not present in the client's handshake (the server has | |
| 46342 | + // indicated an extension not requested by the client), the client | |
| 46343 | + // MUST _Fail the WebSocket Connection_. (The parsing of this | |
| 46344 | + // header field to determine which extensions are requested is | |
| 46345 | + // discussed in Section 9.1.) | |
| 46346 | + const secExtension = response.headersList.get('Sec-WebSocket-Extensions') | |
| 46347 | + | |
| 46348 | + if (secExtension !== null && secExtension !== permessageDeflate) { | |
| 46349 | + failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') | |
| 46350 | + return | |
| 46351 | + } | |
| 46352 | + | |
| 46353 | + // 6. If the response includes a |Sec-WebSocket-Protocol| header field | |
| 46354 | + // and this header field indicates the use of a subprotocol that was | |
| 46355 | + // not present in the client's handshake (the server has indicated a | |
| 46356 | + // subprotocol not requested by the client), the client MUST _Fail | |
| 46357 | + // the WebSocket Connection_. | |
| 46358 | + const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') | |
| 46359 | + | |
| 46360 | + if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { | |
| 46361 | + failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') | |
| 46362 | + return | |
| 46363 | + } | |
| 46364 | + | |
| 46365 | + response.socket.on('data', onSocketData) | |
| 46366 | + response.socket.on('close', onSocketClose) | |
| 46367 | + response.socket.on('error', onSocketError) | |
| 46368 | + | |
| 46369 | + if (channels.open.hasSubscribers) { | |
| 46370 | + channels.open.publish({ | |
| 46371 | + address: response.socket.address(), | |
| 46372 | + protocol: secProtocol, | |
| 46373 | + extensions: secExtension | |
| 46374 | + }) | |
| 46375 | + } | |
| 46376 | + | |
| 46377 | + onEstablish(response) | |
| 46378 | + } | |
| 46379 | + }) | |
| 46380 | + | |
| 46381 | + return controller | |
| 46382 | +} | |
| 46383 | + | |
| 46384 | +/** | |
| 46385 | + * @param {Buffer} chunk | |
| 46386 | + */ | |
| 46387 | +function onSocketData (chunk) { | |
| 46388 | + if (!this.ws[kByteParser].write(chunk)) { | |
| 46389 | + this.pause() | |
| 46390 | + } | |
| 46391 | +} | |
| 46392 | + | |
| 46393 | +/** | |
| 46394 | + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | |
| 46395 | + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 | |
| 46396 | + */ | |
| 46397 | +function onSocketClose () { | |
| 46398 | + const { ws } = this | |
| 46399 | + | |
| 46400 | + // If the TCP connection was closed after the | |
| 46401 | + // WebSocket closing handshake was completed, the WebSocket connection | |
| 46402 | + // is said to have been closed _cleanly_. | |
| 46403 | + const wasClean = ws[kSentClose] && ws[kReceivedClose] | |
| 46404 | + | |
| 46405 | + let code = 1005 | |
| 46406 | + let reason = '' | |
| 46407 | + | |
| 46408 | + const result = ws[kByteParser].closingInfo | |
| 46409 | + | |
| 46410 | + if (result) { | |
| 46411 | + code = result.code ?? 1005 | |
| 46412 | + reason = result.reason | |
| 46413 | + } else if (!ws[kSentClose]) { | |
| 46414 | + // If _The WebSocket | |
| 46415 | + // Connection is Closed_ and no Close control frame was received by the | |
| 46416 | + // endpoint (such as could occur if the underlying transport connection | |
| 46417 | + // is lost), _The WebSocket Connection Close Code_ is considered to be | |
| 46418 | + // 1006. | |
| 46419 | + code = 1006 | |
| 46420 | + } | |
| 46421 | + | |
| 46422 | + // 1. Change the ready state to CLOSED (3). | |
| 46423 | + ws[kReadyState] = states.CLOSED | |
| 46424 | + | |
| 46425 | + // 2. If the user agent was required to fail the WebSocket | |
| 46426 | + // connection, or if the WebSocket connection was closed | |
| 46427 | + // after being flagged as full, fire an event named error | |
| 46428 | + // at the WebSocket object. | |
| 46429 | + // TODO | |
| 46430 | + | |
| 46431 | + // 3. Fire an event named close at the WebSocket object, | |
| 46432 | + // using CloseEvent, with the wasClean attribute | |
| 46433 | + // initialized to true if the connection closed cleanly | |
| 46434 | + // and false otherwise, the code attribute initialized to | |
| 46435 | + // the WebSocket connection close code, and the reason | |
| 46436 | + // attribute initialized to the result of applying UTF-8 | |
| 46437 | + // decode without BOM to the WebSocket connection close | |
| 46438 | + // reason. | |
| 46439 | + fireEvent('close', ws, CloseEvent, { | |
| 46440 | + wasClean, code, reason | |
| 46441 | + }) | |
| 46442 | + | |
| 46443 | + if (channels.close.hasSubscribers) { | |
| 46444 | + channels.close.publish({ | |
| 46445 | + websocket: ws, | |
| 46446 | + code, | |
| 46447 | + reason | |
| 46448 | + }) | |
| 46449 | + } | |
| 46450 | +} | |
| 46451 | + | |
| 46452 | +function onSocketError (error) { | |
| 46453 | + const { ws } = this | |
| 46454 | + | |
| 46455 | + ws[kReadyState] = states.CLOSING | |
| 46456 | + | |
| 46457 | + if (channels.socketError.hasSubscribers) { | |
| 46458 | + channels.socketError.publish(error) | |
| 46459 | + } | |
| 46460 | + | |
| 46461 | + this.destroy() | |
| 46462 | +} | |
| 46463 | + | |
| 46464 | +module.exports = { | |
| 46465 | + establishWebSocketConnection | |
| 46466 | +} | |
| 46467 | + | |
| 46468 | + | |
| 46469 | +/***/ }), | |
| 46470 | + | |
| 46471 | +/***/ 5913: | |
| 46472 | +/***/ ((module) => { | |
| 46473 | + | |
| 46474 | +"use strict"; | |
| 46475 | + | |
| 46476 | + | |
| 46477 | +// This is a Globally Unique Identifier unique used | |
| 46478 | +// to validate that the endpoint accepts websocket | |
| 46479 | +// connections. | |
| 46480 | +// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 | |
| 46481 | +const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' | |
| 46482 | + | |
| 46483 | +/** @type {PropertyDescriptor} */ | |
| 46484 | +const staticPropertyDescriptors = { | |
| 46485 | + enumerable: true, | |
| 46486 | + writable: false, | |
| 46487 | + configurable: false | |
| 46488 | +} | |
| 46489 | + | |
| 46490 | +const states = { | |
| 46491 | + CONNECTING: 0, | |
| 46492 | + OPEN: 1, | |
| 46493 | + CLOSING: 2, | |
| 46494 | + CLOSED: 3 | |
| 46495 | +} | |
| 46496 | + | |
| 46497 | +const opcodes = { | |
| 46498 | + CONTINUATION: 0x0, | |
| 46499 | + TEXT: 0x1, | |
| 46500 | + BINARY: 0x2, | |
| 46501 | + CLOSE: 0x8, | |
| 46502 | + PING: 0x9, | |
| 46503 | + PONG: 0xA | |
| 46504 | +} | |
| 46505 | + | |
| 46506 | +const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 | |
| 46507 | + | |
| 46508 | +const parserStates = { | |
| 46509 | + INFO: 0, | |
| 46510 | + PAYLOADLENGTH_16: 2, | |
| 46511 | + PAYLOADLENGTH_64: 3, | |
| 46512 | + READ_DATA: 4 | |
| 46513 | +} | |
| 46514 | + | |
| 46515 | +const emptyBuffer = Buffer.allocUnsafe(0) | |
| 46516 | + | |
| 46517 | +module.exports = { | |
| 46518 | + uid, | |
| 46519 | + staticPropertyDescriptors, | |
| 46520 | + states, | |
| 46521 | + opcodes, | |
| 46522 | + maxUnsigned16Bit, | |
| 46523 | + parserStates, | |
| 46524 | + emptyBuffer | |
| 46525 | +} | |
| 46526 | + | |
| 46527 | + | |
| 46528 | +/***/ }), | |
| 46529 | + | |
| 46530 | +/***/ 6255: | |
| 46531 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 46532 | + | |
| 46533 | +"use strict"; | |
| 46534 | + | |
| 46535 | + | |
| 46536 | +const { webidl } = __nccwpck_require__(4222) | |
| 46537 | +const { kEnumerableProperty } = __nccwpck_require__(3440) | |
| 46538 | +const { MessagePort } = __nccwpck_require__(8167) | |
| 46539 | + | |
| 46540 | +/** | |
| 46541 | + * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent | |
| 46542 | + */ | |
| 46543 | +class MessageEvent extends Event { | |
| 46544 | + #eventInit | |
| 46545 | + | |
| 46546 | + constructor (type, eventInitDict = {}) { | |
| 46547 | + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) | |
| 46548 | + | |
| 46549 | + type = webidl.converters.DOMString(type) | |
| 46550 | + eventInitDict = webidl.converters.MessageEventInit(eventInitDict) | |
| 46551 | + | |
| 46552 | + super(type, eventInitDict) | |
| 46553 | + | |
| 46554 | + this.#eventInit = eventInitDict | |
| 46555 | + } | |
| 46556 | + | |
| 46557 | + get data () { | |
| 46558 | + webidl.brandCheck(this, MessageEvent) | |
| 46559 | + | |
| 46560 | + return this.#eventInit.data | |
| 46561 | + } | |
| 46562 | + | |
| 46563 | + get origin () { | |
| 46564 | + webidl.brandCheck(this, MessageEvent) | |
| 46565 | + | |
| 46566 | + return this.#eventInit.origin | |
| 46567 | + } | |
| 46568 | + | |
| 46569 | + get lastEventId () { | |
| 46570 | + webidl.brandCheck(this, MessageEvent) | |
| 46571 | + | |
| 46572 | + return this.#eventInit.lastEventId | |
| 46573 | + } | |
| 46574 | + | |
| 46575 | + get source () { | |
| 46576 | + webidl.brandCheck(this, MessageEvent) | |
| 46577 | + | |
| 46578 | + return this.#eventInit.source | |
| 46579 | + } | |
| 46580 | + | |
| 46581 | + get ports () { | |
| 46582 | + webidl.brandCheck(this, MessageEvent) | |
| 46583 | + | |
| 46584 | + if (!Object.isFrozen(this.#eventInit.ports)) { | |
| 46585 | + Object.freeze(this.#eventInit.ports) | |
| 46586 | + } | |
| 46587 | + | |
| 46588 | + return this.#eventInit.ports | |
| 46589 | + } | |
| 46590 | + | |
| 46591 | + initMessageEvent ( | |
| 46592 | + type, | |
| 46593 | + bubbles = false, | |
| 46594 | + cancelable = false, | |
| 46595 | + data = null, | |
| 46596 | + origin = '', | |
| 46597 | + lastEventId = '', | |
| 46598 | + source = null, | |
| 46599 | + ports = [] | |
| 46600 | + ) { | |
| 46601 | + webidl.brandCheck(this, MessageEvent) | |
| 46602 | + | |
| 46603 | + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) | |
| 46604 | + | |
| 46605 | + return new MessageEvent(type, { | |
| 46606 | + bubbles, cancelable, data, origin, lastEventId, source, ports | |
| 46607 | + }) | |
| 46608 | + } | |
| 46609 | +} | |
| 46610 | + | |
| 46611 | +/** | |
| 46612 | + * @see https://websockets.spec.whatwg.org/#the-closeevent-interface | |
| 46613 | + */ | |
| 46614 | +class CloseEvent extends Event { | |
| 46615 | + #eventInit | |
| 46616 | + | |
| 46617 | + constructor (type, eventInitDict = {}) { | |
| 46618 | + webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) | |
| 46619 | + | |
| 46620 | + type = webidl.converters.DOMString(type) | |
| 46621 | + eventInitDict = webidl.converters.CloseEventInit(eventInitDict) | |
| 46622 | + | |
| 46623 | + super(type, eventInitDict) | |
| 46624 | + | |
| 46625 | + this.#eventInit = eventInitDict | |
| 46626 | + } | |
| 46627 | + | |
| 46628 | + get wasClean () { | |
| 46629 | + webidl.brandCheck(this, CloseEvent) | |
| 46630 | + | |
| 46631 | + return this.#eventInit.wasClean | |
| 46632 | + } | |
| 46633 | + | |
| 46634 | + get code () { | |
| 46635 | + webidl.brandCheck(this, CloseEvent) | |
| 46636 | + | |
| 46637 | + return this.#eventInit.code | |
| 46638 | + } | |
| 46639 | + | |
| 46640 | + get reason () { | |
| 46641 | + webidl.brandCheck(this, CloseEvent) | |
| 46642 | + | |
| 46643 | + return this.#eventInit.reason | |
| 46644 | + } | |
| 46645 | +} | |
| 46646 | + | |
| 46647 | +// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface | |
| 46648 | +class ErrorEvent extends Event { | |
| 46649 | + #eventInit | |
| 46650 | + | |
| 46651 | + constructor (type, eventInitDict) { | |
| 46652 | + webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) | |
| 46653 | + | |
| 46654 | + super(type, eventInitDict) | |
| 46655 | + | |
| 46656 | + type = webidl.converters.DOMString(type) | |
| 46657 | + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) | |
| 46658 | + | |
| 46659 | + this.#eventInit = eventInitDict | |
| 46660 | + } | |
| 46661 | + | |
| 46662 | + get message () { | |
| 46663 | + webidl.brandCheck(this, ErrorEvent) | |
| 46664 | + | |
| 46665 | + return this.#eventInit.message | |
| 46666 | + } | |
| 46667 | + | |
| 46668 | + get filename () { | |
| 46669 | + webidl.brandCheck(this, ErrorEvent) | |
| 46670 | + | |
| 46671 | + return this.#eventInit.filename | |
| 46672 | + } | |
| 46673 | + | |
| 46674 | + get lineno () { | |
| 46675 | + webidl.brandCheck(this, ErrorEvent) | |
| 46676 | + | |
| 46677 | + return this.#eventInit.lineno | |
| 46678 | + } | |
| 46679 | + | |
| 46680 | + get colno () { | |
| 46681 | + webidl.brandCheck(this, ErrorEvent) | |
| 46682 | + | |
| 46683 | + return this.#eventInit.colno | |
| 46684 | + } | |
| 46685 | + | |
| 46686 | + get error () { | |
| 46687 | + webidl.brandCheck(this, ErrorEvent) | |
| 46688 | + | |
| 46689 | + return this.#eventInit.error | |
| 46690 | + } | |
| 46691 | +} | |
| 46692 | + | |
| 46693 | +Object.defineProperties(MessageEvent.prototype, { | |
| 46694 | + [Symbol.toStringTag]: { | |
| 46695 | + value: 'MessageEvent', | |
| 46696 | + configurable: true | |
| 46697 | + }, | |
| 46698 | + data: kEnumerableProperty, | |
| 46699 | + origin: kEnumerableProperty, | |
| 46700 | + lastEventId: kEnumerableProperty, | |
| 46701 | + source: kEnumerableProperty, | |
| 46702 | + ports: kEnumerableProperty, | |
| 46703 | + initMessageEvent: kEnumerableProperty | |
| 46704 | +}) | |
| 46705 | + | |
| 46706 | +Object.defineProperties(CloseEvent.prototype, { | |
| 46707 | + [Symbol.toStringTag]: { | |
| 46708 | + value: 'CloseEvent', | |
| 46709 | + configurable: true | |
| 46710 | + }, | |
| 46711 | + reason: kEnumerableProperty, | |
| 46712 | + code: kEnumerableProperty, | |
| 46713 | + wasClean: kEnumerableProperty | |
| 46714 | +}) | |
| 46715 | + | |
| 46716 | +Object.defineProperties(ErrorEvent.prototype, { | |
| 46717 | + [Symbol.toStringTag]: { | |
| 46718 | + value: 'ErrorEvent', | |
| 46719 | + configurable: true | |
| 46720 | + }, | |
| 46721 | + message: kEnumerableProperty, | |
| 46722 | + filename: kEnumerableProperty, | |
| 46723 | + lineno: kEnumerableProperty, | |
| 46724 | + colno: kEnumerableProperty, | |
| 46725 | + error: kEnumerableProperty | |
| 46726 | +}) | |
| 46727 | + | |
| 46728 | +webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) | |
| 46729 | + | |
| 46730 | +webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter( | |
| 46731 | + webidl.converters.MessagePort | |
| 46732 | +) | |
| 46733 | + | |
| 46734 | +const eventInit = [ | |
| 46735 | + { | |
| 46736 | + key: 'bubbles', | |
| 46737 | + converter: webidl.converters.boolean, | |
| 46738 | + defaultValue: false | |
| 46739 | + }, | |
| 46740 | + { | |
| 46741 | + key: 'cancelable', | |
| 46742 | + converter: webidl.converters.boolean, | |
| 46743 | + defaultValue: false | |
| 46744 | + }, | |
| 46745 | + { | |
| 46746 | + key: 'composed', | |
| 46747 | + converter: webidl.converters.boolean, | |
| 46748 | + defaultValue: false | |
| 46749 | + } | |
| 46750 | +] | |
| 46751 | + | |
| 46752 | +webidl.converters.MessageEventInit = webidl.dictionaryConverter([ | |
| 46753 | + ...eventInit, | |
| 46754 | + { | |
| 46755 | + key: 'data', | |
| 46756 | + converter: webidl.converters.any, | |
| 46757 | + defaultValue: null | |
| 46758 | + }, | |
| 46759 | + { | |
| 46760 | + key: 'origin', | |
| 46761 | + converter: webidl.converters.USVString, | |
| 46762 | + defaultValue: '' | |
| 46763 | + }, | |
| 46764 | + { | |
| 46765 | + key: 'lastEventId', | |
| 46766 | + converter: webidl.converters.DOMString, | |
| 46767 | + defaultValue: '' | |
| 46768 | + }, | |
| 46769 | + { | |
| 46770 | + key: 'source', | |
| 46771 | + // Node doesn't implement WindowProxy or ServiceWorker, so the only | |
| 46772 | + // valid value for source is a MessagePort. | |
| 46773 | + converter: webidl.nullableConverter(webidl.converters.MessagePort), | |
| 46774 | + defaultValue: null | |
| 46775 | + }, | |
| 46776 | + { | |
| 46777 | + key: 'ports', | |
| 46778 | + converter: webidl.converters['sequence<MessagePort>'], | |
| 46779 | + get defaultValue () { | |
| 46780 | + return [] | |
| 46781 | + } | |
| 46782 | + } | |
| 46783 | +]) | |
| 46784 | + | |
| 46785 | +webidl.converters.CloseEventInit = webidl.dictionaryConverter([ | |
| 46786 | + ...eventInit, | |
| 46787 | + { | |
| 46788 | + key: 'wasClean', | |
| 46789 | + converter: webidl.converters.boolean, | |
| 46790 | + defaultValue: false | |
| 46791 | + }, | |
| 46792 | + { | |
| 46793 | + key: 'code', | |
| 46794 | + converter: webidl.converters['unsigned short'], | |
| 46795 | + defaultValue: 0 | |
| 46796 | + }, | |
| 46797 | + { | |
| 46798 | + key: 'reason', | |
| 46799 | + converter: webidl.converters.USVString, | |
| 46800 | + defaultValue: '' | |
| 46801 | + } | |
| 46802 | +]) | |
| 46803 | + | |
| 46804 | +webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ | |
| 46805 | + ...eventInit, | |
| 46806 | + { | |
| 46807 | + key: 'message', | |
| 46808 | + converter: webidl.converters.DOMString, | |
| 46809 | + defaultValue: '' | |
| 46810 | + }, | |
| 46811 | + { | |
| 46812 | + key: 'filename', | |
| 46813 | + converter: webidl.converters.USVString, | |
| 46814 | + defaultValue: '' | |
| 46815 | + }, | |
| 46816 | + { | |
| 46817 | + key: 'lineno', | |
| 46818 | + converter: webidl.converters['unsigned long'], | |
| 46819 | + defaultValue: 0 | |
| 46820 | + }, | |
| 46821 | + { | |
| 46822 | + key: 'colno', | |
| 46823 | + converter: webidl.converters['unsigned long'], | |
| 46824 | + defaultValue: 0 | |
| 46825 | + }, | |
| 46826 | + { | |
| 46827 | + key: 'error', | |
| 46828 | + converter: webidl.converters.any | |
| 46829 | + } | |
| 46830 | +]) | |
| 46831 | + | |
| 46832 | +module.exports = { | |
| 46833 | + MessageEvent, | |
| 46834 | + CloseEvent, | |
| 46835 | + ErrorEvent | |
| 46836 | +} | |
| 46837 | + | |
| 46838 | + | |
| 46839 | +/***/ }), | |
| 46840 | + | |
| 46841 | +/***/ 1237: | |
| 46842 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 46843 | + | |
| 46844 | +"use strict"; | |
| 46845 | + | |
| 46846 | + | |
| 46847 | +const { maxUnsigned16Bit } = __nccwpck_require__(5913) | |
| 46848 | + | |
| 46849 | +/** @type {import('crypto')} */ | |
| 46850 | +let crypto | |
| 46851 | +try { | |
| 46852 | + crypto = __nccwpck_require__(6982) | |
| 46853 | +} catch { | |
| 46854 | + | |
| 46855 | +} | |
| 46856 | + | |
| 46857 | +class WebsocketFrameSend { | |
| 46858 | + /** | |
| 46859 | + * @param {Buffer|undefined} data | |
| 46860 | + */ | |
| 46861 | + constructor (data) { | |
| 46862 | + this.frameData = data | |
| 46863 | + this.maskKey = crypto.randomBytes(4) | |
| 46864 | + } | |
| 46865 | + | |
| 46866 | + createFrame (opcode) { | |
| 46867 | + const bodyLength = this.frameData?.byteLength ?? 0 | |
| 46868 | + | |
| 46869 | + /** @type {number} */ | |
| 46870 | + let payloadLength = bodyLength // 0-125 | |
| 46871 | + let offset = 6 | |
| 46872 | + | |
| 46873 | + if (bodyLength > maxUnsigned16Bit) { | |
| 46874 | + offset += 8 // payload length is next 8 bytes | |
| 46875 | + payloadLength = 127 | |
| 46876 | + } else if (bodyLength > 125) { | |
| 46877 | + offset += 2 // payload length is next 2 bytes | |
| 46878 | + payloadLength = 126 | |
| 46879 | + } | |
| 46880 | + | |
| 46881 | + const buffer = Buffer.allocUnsafe(bodyLength + offset) | |
| 46882 | + | |
| 46883 | + // Clear first 2 bytes, everything else is overwritten | |
| 46884 | + buffer[0] = buffer[1] = 0 | |
| 46885 | + buffer[0] |= 0x80 // FIN | |
| 46886 | + buffer[0] = (buffer[0] & 0xF0) + opcode // opcode | |
| 46887 | + | |
| 46888 | + /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */ | |
| 46889 | + buffer[offset - 4] = this.maskKey[0] | |
| 46890 | + buffer[offset - 3] = this.maskKey[1] | |
| 46891 | + buffer[offset - 2] = this.maskKey[2] | |
| 46892 | + buffer[offset - 1] = this.maskKey[3] | |
| 46893 | + | |
| 46894 | + buffer[1] = payloadLength | |
| 46895 | + | |
| 46896 | + if (payloadLength === 126) { | |
| 46897 | + buffer.writeUInt16BE(bodyLength, 2) | |
| 46898 | + } else if (payloadLength === 127) { | |
| 46899 | + // Clear extended payload length | |
| 46900 | + buffer[2] = buffer[3] = 0 | |
| 46901 | + buffer.writeUIntBE(bodyLength, 4, 6) | |
| 46902 | + } | |
| 46903 | + | |
| 46904 | + buffer[1] |= 0x80 // MASK | |
| 46905 | + | |
| 46906 | + // mask body | |
| 46907 | + for (let i = 0; i < bodyLength; i++) { | |
| 46908 | + buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] | |
| 46909 | + } | |
| 46910 | + | |
| 46911 | + return buffer | |
| 46912 | + } | |
| 46913 | +} | |
| 46914 | + | |
| 46915 | +module.exports = { | |
| 46916 | + WebsocketFrameSend | |
| 46917 | +} | |
| 46918 | + | |
| 46919 | + | |
| 46920 | +/***/ }), | |
| 46921 | + | |
| 46922 | +/***/ 3171: | |
| 46923 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 46924 | + | |
| 46925 | +"use strict"; | |
| 46926 | + | |
| 46927 | + | |
| 46928 | +const { Writable } = __nccwpck_require__(2203) | |
| 46929 | +const diagnosticsChannel = __nccwpck_require__(1637) | |
| 46930 | +const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(5913) | |
| 46931 | +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(2933) | |
| 46932 | +const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(3574) | |
| 46933 | +const { WebsocketFrameSend } = __nccwpck_require__(1237) | |
| 46934 | + | |
| 46935 | +// This code was influenced by ws released under the MIT license. | |
| 46936 | +// Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com> | |
| 46937 | +// Copyright (c) 2013 Arnout Kazemier and contributors | |
| 46938 | +// Copyright (c) 2016 Luigi Pinca and contributors | |
| 46939 | + | |
| 46940 | +const channels = {} | |
| 46941 | +channels.ping = diagnosticsChannel.channel('undici:websocket:ping') | |
| 46942 | +channels.pong = diagnosticsChannel.channel('undici:websocket:pong') | |
| 46943 | + | |
| 46944 | +class ByteParser extends Writable { | |
| 46945 | + #buffers = [] | |
| 46946 | + #byteOffset = 0 | |
| 46947 | + | |
| 46948 | + #state = parserStates.INFO | |
| 46949 | + | |
| 46950 | + #info = {} | |
| 46951 | + #fragments = [] | |
| 46952 | + | |
| 46953 | + constructor (ws) { | |
| 46954 | + super() | |
| 46955 | + | |
| 46956 | + this.ws = ws | |
| 46957 | + } | |
| 46958 | + | |
| 46959 | + /** | |
| 46960 | + * @param {Buffer} chunk | |
| 46961 | + * @param {() => void} callback | |
| 46962 | + */ | |
| 46963 | + _write (chunk, _, callback) { | |
| 46964 | + this.#buffers.push(chunk) | |
| 46965 | + this.#byteOffset += chunk.length | |
| 46966 | + | |
| 46967 | + this.run(callback) | |
| 46968 | + } | |
| 46969 | + | |
| 46970 | + /** | |
| 46971 | + * Runs whenever a new chunk is received. | |
| 46972 | + * Callback is called whenever there are no more chunks buffering, | |
| 46973 | + * or not enough bytes are buffered to parse. | |
| 46974 | + */ | |
| 46975 | + run (callback) { | |
| 46976 | + while (true) { | |
| 46977 | + if (this.#state === parserStates.INFO) { | |
| 46978 | + // If there aren't enough bytes to parse the payload length, etc. | |
| 46979 | + if (this.#byteOffset < 2) { | |
| 46980 | + return callback() | |
| 46981 | + } | |
| 46982 | + | |
| 46983 | + const buffer = this.consume(2) | |
| 46984 | + | |
| 46985 | + this.#info.fin = (buffer[0] & 0x80) !== 0 | |
| 46986 | + this.#info.opcode = buffer[0] & 0x0F | |
| 46987 | + | |
| 46988 | + // If we receive a fragmented message, we use the type of the first | |
| 46989 | + // frame to parse the full message as binary/text, when it's terminated | |
| 46990 | + this.#info.originalOpcode ??= this.#info.opcode | |
| 46991 | + | |
| 46992 | + this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION | |
| 46993 | + | |
| 46994 | + if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { | |
| 46995 | + // Only text and binary frames can be fragmented | |
| 46996 | + failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') | |
| 46997 | + return | |
| 46998 | + } | |
| 46999 | + | |
| 47000 | + const payloadLength = buffer[1] & 0x7F | |
| 47001 | + | |
| 47002 | + if (payloadLength <= 125) { | |
| 47003 | + this.#info.payloadLength = payloadLength | |
| 47004 | + this.#state = parserStates.READ_DATA | |
| 47005 | + } else if (payloadLength === 126) { | |
| 47006 | + this.#state = parserStates.PAYLOADLENGTH_16 | |
| 47007 | + } else if (payloadLength === 127) { | |
| 47008 | + this.#state = parserStates.PAYLOADLENGTH_64 | |
| 47009 | + } | |
| 47010 | + | |
| 47011 | + if (this.#info.fragmented && payloadLength > 125) { | |
| 47012 | + // A fragmented frame can't be fragmented itself | |
| 47013 | + failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') | |
| 47014 | + return | |
| 47015 | + } else if ( | |
| 47016 | + (this.#info.opcode === opcodes.PING || | |
| 47017 | + this.#info.opcode === opcodes.PONG || | |
| 47018 | + this.#info.opcode === opcodes.CLOSE) && | |
| 47019 | + payloadLength > 125 | |
| 47020 | + ) { | |
| 47021 | + // Control frames can have a payload length of 125 bytes MAX | |
| 47022 | + failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') | |
| 47023 | + return | |
| 47024 | + } else if (this.#info.opcode === opcodes.CLOSE) { | |
| 47025 | + if (payloadLength === 1) { | |
| 47026 | + failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') | |
| 47027 | + return | |
| 47028 | + } | |
| 47029 | + | |
| 47030 | + const body = this.consume(payloadLength) | |
| 47031 | + | |
| 47032 | + this.#info.closeInfo = this.parseCloseBody(false, body) | |
| 47033 | + | |
| 47034 | + if (!this.ws[kSentClose]) { | |
| 47035 | + // If an endpoint receives a Close frame and did not previously send a | |
| 47036 | + // Close frame, the endpoint MUST send a Close frame in response. (When | |
| 47037 | + // sending a Close frame in response, the endpoint typically echos the | |
| 47038 | + // status code it received.) | |
| 47039 | + const body = Buffer.allocUnsafe(2) | |
| 47040 | + body.writeUInt16BE(this.#info.closeInfo.code, 0) | |
| 47041 | + const closeFrame = new WebsocketFrameSend(body) | |
| 47042 | + | |
| 47043 | + this.ws[kResponse].socket.write( | |
| 47044 | + closeFrame.createFrame(opcodes.CLOSE), | |
| 47045 | + (err) => { | |
| 47046 | + if (!err) { | |
| 47047 | + this.ws[kSentClose] = true | |
| 47048 | + } | |
| 47049 | + } | |
| 47050 | + ) | |
| 47051 | + } | |
| 47052 | + | |
| 47053 | + // Upon either sending or receiving a Close control frame, it is said | |
| 47054 | + // that _The WebSocket Closing Handshake is Started_ and that the | |
| 47055 | + // WebSocket connection is in the CLOSING state. | |
| 47056 | + this.ws[kReadyState] = states.CLOSING | |
| 47057 | + this.ws[kReceivedClose] = true | |
| 47058 | + | |
| 47059 | + this.end() | |
| 47060 | + | |
| 47061 | + return | |
| 47062 | + } else if (this.#info.opcode === opcodes.PING) { | |
| 47063 | + // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in | |
| 47064 | + // response, unless it already received a Close frame. | |
| 47065 | + // A Pong frame sent in response to a Ping frame must have identical | |
| 47066 | + // "Application data" | |
| 47067 | + | |
| 47068 | + const body = this.consume(payloadLength) | |
| 47069 | + | |
| 47070 | + if (!this.ws[kReceivedClose]) { | |
| 47071 | + const frame = new WebsocketFrameSend(body) | |
| 47072 | + | |
| 47073 | + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) | |
| 47074 | + | |
| 47075 | + if (channels.ping.hasSubscribers) { | |
| 47076 | + channels.ping.publish({ | |
| 47077 | + payload: body | |
| 47078 | + }) | |
| 47079 | + } | |
| 47080 | + } | |
| 47081 | + | |
| 47082 | + this.#state = parserStates.INFO | |
| 47083 | + | |
| 47084 | + if (this.#byteOffset > 0) { | |
| 47085 | + continue | |
| 47086 | + } else { | |
| 47087 | + callback() | |
| 47088 | + return | |
| 47089 | + } | |
| 47090 | + } else if (this.#info.opcode === opcodes.PONG) { | |
| 47091 | + // A Pong frame MAY be sent unsolicited. This serves as a | |
| 47092 | + // unidirectional heartbeat. A response to an unsolicited Pong frame is | |
| 47093 | + // not expected. | |
| 47094 | + | |
| 47095 | + const body = this.consume(payloadLength) | |
| 47096 | + | |
| 47097 | + if (channels.pong.hasSubscribers) { | |
| 47098 | + channels.pong.publish({ | |
| 47099 | + payload: body | |
| 47100 | + }) | |
| 47101 | + } | |
| 47102 | + | |
| 47103 | + if (this.#byteOffset > 0) { | |
| 47104 | + continue | |
| 47105 | + } else { | |
| 47106 | + callback() | |
| 47107 | + return | |
| 47108 | + } | |
| 47109 | + } | |
| 47110 | + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { | |
| 47111 | + if (this.#byteOffset < 2) { | |
| 47112 | + return callback() | |
| 47113 | + } | |
| 47114 | + | |
| 47115 | + const buffer = this.consume(2) | |
| 47116 | + | |
| 47117 | + this.#info.payloadLength = buffer.readUInt16BE(0) | |
| 47118 | + this.#state = parserStates.READ_DATA | |
| 47119 | + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { | |
| 47120 | + if (this.#byteOffset < 8) { | |
| 47121 | + return callback() | |
| 47122 | + } | |
| 47123 | + | |
| 47124 | + const buffer = this.consume(8) | |
| 47125 | + const upper = buffer.readUInt32BE(0) | |
| 47126 | + | |
| 47127 | + // 2^31 is the maxinimum bytes an arraybuffer can contain | |
| 47128 | + // on 32-bit systems. Although, on 64-bit systems, this is | |
| 47129 | + // 2^53-1 bytes. | |
| 47130 | + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length | |
| 47131 | + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 | |
| 47132 | + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e | |
| 47133 | + if (upper > 2 ** 31 - 1) { | |
| 47134 | + failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') | |
| 47135 | + return | |
| 47136 | + } | |
| 47137 | + | |
| 47138 | + const lower = buffer.readUInt32BE(4) | |
| 47139 | + | |
| 47140 | + this.#info.payloadLength = (upper << 8) + lower | |
| 47141 | + this.#state = parserStates.READ_DATA | |
| 47142 | + } else if (this.#state === parserStates.READ_DATA) { | |
| 47143 | + if (this.#byteOffset < this.#info.payloadLength) { | |
| 47144 | + // If there is still more data in this chunk that needs to be read | |
| 47145 | + return callback() | |
| 47146 | + } else if (this.#byteOffset >= this.#info.payloadLength) { | |
| 47147 | + // If the server sent multiple frames in a single chunk | |
| 47148 | + | |
| 47149 | + const body = this.consume(this.#info.payloadLength) | |
| 47150 | + | |
| 47151 | + this.#fragments.push(body) | |
| 47152 | + | |
| 47153 | + // If the frame is unfragmented, or a fragmented frame was terminated, | |
| 47154 | + // a message was received | |
| 47155 | + if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { | |
| 47156 | + const fullMessage = Buffer.concat(this.#fragments) | |
| 47157 | + | |
| 47158 | + websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) | |
| 47159 | + | |
| 47160 | + this.#info = {} | |
| 47161 | + this.#fragments.length = 0 | |
| 47162 | + } | |
| 47163 | + | |
| 47164 | + this.#state = parserStates.INFO | |
| 47165 | + } | |
| 47166 | + } | |
| 47167 | + | |
| 47168 | + if (this.#byteOffset > 0) { | |
| 47169 | + continue | |
| 47170 | + } else { | |
| 47171 | + callback() | |
| 47172 | + break | |
| 47173 | + } | |
| 47174 | + } | |
| 47175 | + } | |
| 47176 | + | |
| 47177 | + /** | |
| 47178 | + * Take n bytes from the buffered Buffers | |
| 47179 | + * @param {number} n | |
| 47180 | + * @returns {Buffer|null} | |
| 47181 | + */ | |
| 47182 | + consume (n) { | |
| 47183 | + if (n > this.#byteOffset) { | |
| 47184 | + return null | |
| 47185 | + } else if (n === 0) { | |
| 47186 | + return emptyBuffer | |
| 47187 | + } | |
| 47188 | + | |
| 47189 | + if (this.#buffers[0].length === n) { | |
| 47190 | + this.#byteOffset -= this.#buffers[0].length | |
| 47191 | + return this.#buffers.shift() | |
| 47192 | + } | |
| 47193 | + | |
| 47194 | + const buffer = Buffer.allocUnsafe(n) | |
| 47195 | + let offset = 0 | |
| 47196 | + | |
| 47197 | + while (offset !== n) { | |
| 47198 | + const next = this.#buffers[0] | |
| 47199 | + const { length } = next | |
| 47200 | + | |
| 47201 | + if (length + offset === n) { | |
| 47202 | + buffer.set(this.#buffers.shift(), offset) | |
| 47203 | + break | |
| 47204 | + } else if (length + offset > n) { | |
| 47205 | + buffer.set(next.subarray(0, n - offset), offset) | |
| 47206 | + this.#buffers[0] = next.subarray(n - offset) | |
| 47207 | + break | |
| 47208 | + } else { | |
| 47209 | + buffer.set(this.#buffers.shift(), offset) | |
| 47210 | + offset += next.length | |
| 47211 | + } | |
| 47212 | + } | |
| 47213 | + | |
| 47214 | + this.#byteOffset -= n | |
| 47215 | + | |
| 47216 | + return buffer | |
| 47217 | + } | |
| 47218 | + | |
| 47219 | + parseCloseBody (onlyCode, data) { | |
| 47220 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 | |
| 47221 | + /** @type {number|undefined} */ | |
| 47222 | + let code | |
| 47223 | + | |
| 47224 | + if (data.length >= 2) { | |
| 47225 | + // _The WebSocket Connection Close Code_ is | |
| 47226 | + // defined as the status code (Section 7.4) contained in the first Close | |
| 47227 | + // control frame received by the application | |
| 47228 | + code = data.readUInt16BE(0) | |
| 47229 | + } | |
| 47230 | + | |
| 47231 | + if (onlyCode) { | |
| 47232 | + if (!isValidStatusCode(code)) { | |
| 47233 | + return null | |
| 47234 | + } | |
| 47235 | + | |
| 47236 | + return { code } | |
| 47237 | + } | |
| 47238 | + | |
| 47239 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 | |
| 47240 | + /** @type {Buffer} */ | |
| 47241 | + let reason = data.subarray(2) | |
| 47242 | + | |
| 47243 | + // Remove BOM | |
| 47244 | + if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { | |
| 47245 | + reason = reason.subarray(3) | |
| 47246 | + } | |
| 47247 | + | |
| 47248 | + if (code !== undefined && !isValidStatusCode(code)) { | |
| 47249 | + return null | |
| 47250 | + } | |
| 47251 | + | |
| 47252 | + try { | |
| 47253 | + // TODO: optimize this | |
| 47254 | + reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) | |
| 47255 | + } catch { | |
| 47256 | + return null | |
| 47257 | + } | |
| 47258 | + | |
| 47259 | + return { code, reason } | |
| 47260 | + } | |
| 47261 | + | |
| 47262 | + get closingInfo () { | |
| 47263 | + return this.#info.closeInfo | |
| 47264 | + } | |
| 47265 | +} | |
| 47266 | + | |
| 47267 | +module.exports = { | |
| 47268 | + ByteParser | |
| 47269 | +} | |
| 47270 | + | |
| 47271 | + | |
| 47272 | +/***/ }), | |
| 47273 | + | |
| 47274 | +/***/ 2933: | |
| 47275 | +/***/ ((module) => { | |
| 47276 | + | |
| 47277 | +"use strict"; | |
| 47278 | + | |
| 47279 | + | |
| 47280 | +module.exports = { | |
| 47281 | + kWebSocketURL: Symbol('url'), | |
| 47282 | + kReadyState: Symbol('ready state'), | |
| 47283 | + kController: Symbol('controller'), | |
| 47284 | + kResponse: Symbol('response'), | |
| 47285 | + kBinaryType: Symbol('binary type'), | |
| 47286 | + kSentClose: Symbol('sent close'), | |
| 47287 | + kReceivedClose: Symbol('received close'), | |
| 47288 | + kByteParser: Symbol('byte parser') | |
| 47289 | +} | |
| 47290 | + | |
| 47291 | + | |
| 47292 | +/***/ }), | |
| 47293 | + | |
| 47294 | +/***/ 3574: | |
| 47295 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 47296 | + | |
| 47297 | +"use strict"; | |
| 47298 | + | |
| 47299 | + | |
| 47300 | +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2933) | |
| 47301 | +const { states, opcodes } = __nccwpck_require__(5913) | |
| 47302 | +const { MessageEvent, ErrorEvent } = __nccwpck_require__(6255) | |
| 47303 | + | |
| 47304 | +/* globals Blob */ | |
| 47305 | + | |
| 47306 | +/** | |
| 47307 | + * @param {import('./websocket').WebSocket} ws | |
| 47308 | + */ | |
| 47309 | +function isEstablished (ws) { | |
| 47310 | + // If the server's response is validated as provided for above, it is | |
| 47311 | + // said that _The WebSocket Connection is Established_ and that the | |
| 47312 | + // WebSocket Connection is in the OPEN state. | |
| 47313 | + return ws[kReadyState] === states.OPEN | |
| 47314 | +} | |
| 47315 | + | |
| 47316 | +/** | |
| 47317 | + * @param {import('./websocket').WebSocket} ws | |
| 47318 | + */ | |
| 47319 | +function isClosing (ws) { | |
| 47320 | + // Upon either sending or receiving a Close control frame, it is said | |
| 47321 | + // that _The WebSocket Closing Handshake is Started_ and that the | |
| 47322 | + // WebSocket connection is in the CLOSING state. | |
| 47323 | + return ws[kReadyState] === states.CLOSING | |
| 47324 | +} | |
| 47325 | + | |
| 47326 | +/** | |
| 47327 | + * @param {import('./websocket').WebSocket} ws | |
| 47328 | + */ | |
| 47329 | +function isClosed (ws) { | |
| 47330 | + return ws[kReadyState] === states.CLOSED | |
| 47331 | +} | |
| 47332 | + | |
| 47333 | +/** | |
| 47334 | + * @see https://dom.spec.whatwg.org/#concept-event-fire | |
| 47335 | + * @param {string} e | |
| 47336 | + * @param {EventTarget} target | |
| 47337 | + * @param {EventInit | undefined} eventInitDict | |
| 47338 | + */ | |
| 47339 | +function fireEvent (e, target, eventConstructor = Event, eventInitDict) { | |
| 47340 | + // 1. If eventConstructor is not given, then let eventConstructor be Event. | |
| 47341 | + | |
| 47342 | + // 2. Let event be the result of creating an event given eventConstructor, | |
| 47343 | + // in the relevant realm of target. | |
| 47344 | + // 3. Initialize event’s type attribute to e. | |
| 47345 | + const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap | |
| 47346 | + | |
| 47347 | + // 4. Initialize any other IDL attributes of event as described in the | |
| 47348 | + // invocation of this algorithm. | |
| 47349 | + | |
| 47350 | + // 5. Return the result of dispatching event at target, with legacy target | |
| 47351 | + // override flag set if set. | |
| 47352 | + target.dispatchEvent(event) | |
| 47353 | +} | |
| 47354 | + | |
| 47355 | +/** | |
| 47356 | + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | |
| 47357 | + * @param {import('./websocket').WebSocket} ws | |
| 47358 | + * @param {number} type Opcode | |
| 47359 | + * @param {Buffer} data application data | |
| 47360 | + */ | |
| 47361 | +function websocketMessageReceived (ws, type, data) { | |
| 47362 | + // 1. If ready state is not OPEN (1), then return. | |
| 47363 | + if (ws[kReadyState] !== states.OPEN) { | |
| 47364 | + return | |
| 47365 | + } | |
| 47366 | + | |
| 47367 | + // 2. Let dataForEvent be determined by switching on type and binary type: | |
| 47368 | + let dataForEvent | |
| 47369 | + | |
| 47370 | + if (type === opcodes.TEXT) { | |
| 47371 | + // -> type indicates that the data is Text | |
| 47372 | + // a new DOMString containing data | |
| 47373 | + try { | |
| 47374 | + dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) | |
| 47375 | + } catch { | |
| 47376 | + failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') | |
| 47377 | + return | |
| 47378 | + } | |
| 47379 | + } else if (type === opcodes.BINARY) { | |
| 47380 | + if (ws[kBinaryType] === 'blob') { | |
| 47381 | + // -> type indicates that the data is Binary and binary type is "blob" | |
| 47382 | + // a new Blob object, created in the relevant Realm of the WebSocket | |
| 47383 | + // object, that represents data as its raw data | |
| 47384 | + dataForEvent = new Blob([data]) | |
| 47385 | + } else { | |
| 47386 | + // -> type indicates that the data is Binary and binary type is "arraybuffer" | |
| 47387 | + // a new ArrayBuffer object, created in the relevant Realm of the | |
| 47388 | + // WebSocket object, whose contents are data | |
| 47389 | + dataForEvent = new Uint8Array(data).buffer | |
| 47390 | + } | |
| 47391 | + } | |
| 47392 | + | |
| 47393 | + // 3. Fire an event named message at the WebSocket object, using MessageEvent, | |
| 47394 | + // with the origin attribute initialized to the serialization of the WebSocket | |
| 47395 | + // object’s url's origin, and the data attribute initialized to dataForEvent. | |
| 47396 | + fireEvent('message', ws, MessageEvent, { | |
| 47397 | + origin: ws[kWebSocketURL].origin, | |
| 47398 | + data: dataForEvent | |
| 47399 | + }) | |
| 47400 | +} | |
| 47401 | + | |
| 47402 | +/** | |
| 47403 | + * @see https://datatracker.ietf.org/doc/html/rfc6455 | |
| 47404 | + * @see https://datatracker.ietf.org/doc/html/rfc2616 | |
| 47405 | + * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 | |
| 47406 | + * @param {string} protocol | |
| 47407 | + */ | |
| 47408 | +function isValidSubprotocol (protocol) { | |
| 47409 | + // If present, this value indicates one | |
| 47410 | + // or more comma-separated subprotocol the client wishes to speak, | |
| 47411 | + // ordered by preference. The elements that comprise this value | |
| 47412 | + // MUST be non-empty strings with characters in the range U+0021 to | |
| 47413 | + // U+007E not including separator characters as defined in | |
| 47414 | + // [RFC2616] and MUST all be unique strings. | |
| 47415 | + if (protocol.length === 0) { | |
| 47416 | + return false | |
| 47417 | + } | |
| 47418 | + | |
| 47419 | + for (const char of protocol) { | |
| 47420 | + const code = char.charCodeAt(0) | |
| 47421 | + | |
| 47422 | + if ( | |
| 47423 | + code < 0x21 || | |
| 47424 | + code > 0x7E || | |
| 47425 | + char === '(' || | |
| 47426 | + char === ')' || | |
| 47427 | + char === '<' || | |
| 47428 | + char === '>' || | |
| 47429 | + char === '@' || | |
| 47430 | + char === ',' || | |
| 47431 | + char === ';' || | |
| 47432 | + char === ':' || | |
| 47433 | + char === '\\' || | |
| 47434 | + char === '"' || | |
| 47435 | + char === '/' || | |
| 47436 | + char === '[' || | |
| 47437 | + char === ']' || | |
| 47438 | + char === '?' || | |
| 47439 | + char === '=' || | |
| 47440 | + char === '{' || | |
| 47441 | + char === '}' || | |
| 47442 | + code === 32 || // SP | |
| 47443 | + code === 9 // HT | |
| 47444 | + ) { | |
| 47445 | + return false | |
| 47446 | + } | |
| 47447 | + } | |
| 47448 | + | |
| 47449 | + return true | |
| 47450 | +} | |
| 47451 | + | |
| 47452 | +/** | |
| 47453 | + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 | |
| 47454 | + * @param {number} code | |
| 47455 | + */ | |
| 47456 | +function isValidStatusCode (code) { | |
| 47457 | + if (code >= 1000 && code < 1015) { | |
| 47458 | + return ( | |
| 47459 | + code !== 1004 && // reserved | |
| 47460 | + code !== 1005 && // "MUST NOT be set as a status code" | |
| 47461 | + code !== 1006 // "MUST NOT be set as a status code" | |
| 47462 | + ) | |
| 47463 | + } | |
| 47464 | + | |
| 47465 | + return code >= 3000 && code <= 4999 | |
| 47466 | +} | |
| 47467 | + | |
| 47468 | +/** | |
| 47469 | + * @param {import('./websocket').WebSocket} ws | |
| 47470 | + * @param {string|undefined} reason | |
| 47471 | + */ | |
| 47472 | +function failWebsocketConnection (ws, reason) { | |
| 47473 | + const { [kController]: controller, [kResponse]: response } = ws | |
| 47474 | + | |
| 47475 | + controller.abort() | |
| 47476 | + | |
| 47477 | + if (response?.socket && !response.socket.destroyed) { | |
| 47478 | + response.socket.destroy() | |
| 47479 | + } | |
| 47480 | + | |
| 47481 | + if (reason) { | |
| 47482 | + fireEvent('error', ws, ErrorEvent, { | |
| 47483 | + error: new Error(reason) | |
| 47484 | + }) | |
| 47485 | + } | |
| 47486 | +} | |
| 47487 | + | |
| 47488 | +module.exports = { | |
| 47489 | + isEstablished, | |
| 47490 | + isClosing, | |
| 47491 | + isClosed, | |
| 47492 | + fireEvent, | |
| 47493 | + isValidSubprotocol, | |
| 47494 | + isValidStatusCode, | |
| 47495 | + failWebsocketConnection, | |
| 47496 | + websocketMessageReceived | |
| 47497 | +} | |
| 47498 | + | |
| 47499 | + | |
| 47500 | +/***/ }), | |
| 47501 | + | |
| 47502 | +/***/ 5171: | |
| 47503 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 47504 | + | |
| 47505 | +"use strict"; | |
| 47506 | + | |
| 47507 | + | |
| 47508 | +const { webidl } = __nccwpck_require__(4222) | |
| 47509 | +const { DOMException } = __nccwpck_require__(7326) | |
| 47510 | +const { URLSerializer } = __nccwpck_require__(4322) | |
| 47511 | +const { getGlobalOrigin } = __nccwpck_require__(5628) | |
| 47512 | +const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(5913) | |
| 47513 | +const { | |
| 47514 | + kWebSocketURL, | |
| 47515 | + kReadyState, | |
| 47516 | + kController, | |
| 47517 | + kBinaryType, | |
| 47518 | + kResponse, | |
| 47519 | + kSentClose, | |
| 47520 | + kByteParser | |
| 47521 | +} = __nccwpck_require__(2933) | |
| 47522 | +const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(3574) | |
| 47523 | +const { establishWebSocketConnection } = __nccwpck_require__(8550) | |
| 47524 | +const { WebsocketFrameSend } = __nccwpck_require__(1237) | |
| 47525 | +const { ByteParser } = __nccwpck_require__(3171) | |
| 47526 | +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3440) | |
| 47527 | +const { getGlobalDispatcher } = __nccwpck_require__(2581) | |
| 47528 | +const { types } = __nccwpck_require__(9023) | |
| 47529 | + | |
| 47530 | +let experimentalWarned = false | |
| 47531 | + | |
| 47532 | +// https://websockets.spec.whatwg.org/#interface-definition | |
| 47533 | +class WebSocket extends EventTarget { | |
| 47534 | + #events = { | |
| 47535 | + open: null, | |
| 47536 | + error: null, | |
| 47537 | + close: null, | |
| 47538 | + message: null | |
| 47539 | + } | |
| 47540 | + | |
| 47541 | + #bufferedAmount = 0 | |
| 47542 | + #protocol = '' | |
| 47543 | + #extensions = '' | |
| 47544 | + | |
| 47545 | + /** | |
| 47546 | + * @param {string} url | |
| 47547 | + * @param {string|string[]} protocols | |
| 47548 | + */ | |
| 47549 | + constructor (url, protocols = []) { | |
| 47550 | + super() | |
| 47551 | + | |
| 47552 | + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) | |
| 47553 | + | |
| 47554 | + if (!experimentalWarned) { | |
| 47555 | + experimentalWarned = true | |
| 47556 | + process.emitWarning('WebSockets are experimental, expect them to change at any time.', { | |
| 47557 | + code: 'UNDICI-WS' | |
| 47558 | + }) | |
| 47559 | + } | |
| 47560 | + | |
| 47561 | + const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols) | |
| 47562 | + | |
| 47563 | + url = webidl.converters.USVString(url) | |
| 47564 | + protocols = options.protocols | |
| 47565 | + | |
| 47566 | + // 1. Let baseURL be this's relevant settings object's API base URL. | |
| 47567 | + const baseURL = getGlobalOrigin() | |
| 47568 | + | |
| 47569 | + // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. | |
| 47570 | + let urlRecord | |
| 47571 | + | |
| 47572 | + try { | |
| 47573 | + urlRecord = new URL(url, baseURL) | |
| 47574 | + } catch (e) { | |
| 47575 | + // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. | |
| 47576 | + throw new DOMException(e, 'SyntaxError') | |
| 47577 | + } | |
| 47578 | + | |
| 47579 | + // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". | |
| 47580 | + if (urlRecord.protocol === 'http:') { | |
| 47581 | + urlRecord.protocol = 'ws:' | |
| 47582 | + } else if (urlRecord.protocol === 'https:') { | |
| 47583 | + // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". | |
| 47584 | + urlRecord.protocol = 'wss:' | |
| 47585 | + } | |
| 47586 | + | |
| 47587 | + // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. | |
| 47588 | + if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { | |
| 47589 | + throw new DOMException( | |
| 47590 | + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, | |
| 47591 | + 'SyntaxError' | |
| 47592 | + ) | |
| 47593 | + } | |
| 47594 | + | |
| 47595 | + // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" | |
| 47596 | + // DOMException. | |
| 47597 | + if (urlRecord.hash || urlRecord.href.endsWith('#')) { | |
| 47598 | + throw new DOMException('Got fragment', 'SyntaxError') | |
| 47599 | + } | |
| 47600 | + | |
| 47601 | + // 8. If protocols is a string, set protocols to a sequence consisting | |
| 47602 | + // of just that string. | |
| 47603 | + if (typeof protocols === 'string') { | |
| 47604 | + protocols = [protocols] | |
| 47605 | + } | |
| 47606 | + | |
| 47607 | + // 9. If any of the values in protocols occur more than once or otherwise | |
| 47608 | + // fail to match the requirements for elements that comprise the value | |
| 47609 | + // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket | |
| 47610 | + // protocol, then throw a "SyntaxError" DOMException. | |
| 47611 | + if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { | |
| 47612 | + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') | |
| 47613 | + } | |
| 47614 | + | |
| 47615 | + if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { | |
| 47616 | + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') | |
| 47617 | + } | |
| 47618 | + | |
| 47619 | + // 10. Set this's url to urlRecord. | |
| 47620 | + this[kWebSocketURL] = new URL(urlRecord.href) | |
| 47621 | + | |
| 47622 | + // 11. Let client be this's relevant settings object. | |
| 47623 | + | |
| 47624 | + // 12. Run this step in parallel: | |
| 47625 | + | |
| 47626 | + // 1. Establish a WebSocket connection given urlRecord, protocols, | |
| 47627 | + // and client. | |
| 47628 | + this[kController] = establishWebSocketConnection( | |
| 47629 | + urlRecord, | |
| 47630 | + protocols, | |
| 47631 | + this, | |
| 47632 | + (response) => this.#onConnectionEstablished(response), | |
| 47633 | + options | |
| 47634 | + ) | |
| 47635 | + | |
| 47636 | + // Each WebSocket object has an associated ready state, which is a | |
| 47637 | + // number representing the state of the connection. Initially it must | |
| 47638 | + // be CONNECTING (0). | |
| 47639 | + this[kReadyState] = WebSocket.CONNECTING | |
| 47640 | + | |
| 47641 | + // The extensions attribute must initially return the empty string. | |
| 47642 | + | |
| 47643 | + // The protocol attribute must initially return the empty string. | |
| 47644 | + | |
| 47645 | + // Each WebSocket object has an associated binary type, which is a | |
| 47646 | + // BinaryType. Initially it must be "blob". | |
| 47647 | + this[kBinaryType] = 'blob' | |
| 47648 | + } | |
| 47649 | + | |
| 47650 | + /** | |
| 47651 | + * @see https://websockets.spec.whatwg.org/#dom-websocket-close | |
| 47652 | + * @param {number|undefined} code | |
| 47653 | + * @param {string|undefined} reason | |
| 47654 | + */ | |
| 47655 | + close (code = undefined, reason = undefined) { | |
| 47656 | + webidl.brandCheck(this, WebSocket) | |
| 47657 | + | |
| 47658 | + if (code !== undefined) { | |
| 47659 | + code = webidl.converters['unsigned short'](code, { clamp: true }) | |
| 47660 | + } | |
| 47661 | + | |
| 47662 | + if (reason !== undefined) { | |
| 47663 | + reason = webidl.converters.USVString(reason) | |
| 47664 | + } | |
| 47665 | + | |
| 47666 | + // 1. If code is present, but is neither an integer equal to 1000 nor an | |
| 47667 | + // integer in the range 3000 to 4999, inclusive, throw an | |
| 47668 | + // "InvalidAccessError" DOMException. | |
| 47669 | + if (code !== undefined) { | |
| 47670 | + if (code !== 1000 && (code < 3000 || code > 4999)) { | |
| 47671 | + throw new DOMException('invalid code', 'InvalidAccessError') | |
| 47672 | + } | |
| 47673 | + } | |
| 47674 | + | |
| 47675 | + let reasonByteLength = 0 | |
| 47676 | + | |
| 47677 | + // 2. If reason is present, then run these substeps: | |
| 47678 | + if (reason !== undefined) { | |
| 47679 | + // 1. Let reasonBytes be the result of encoding reason. | |
| 47680 | + // 2. If reasonBytes is longer than 123 bytes, then throw a | |
| 47681 | + // "SyntaxError" DOMException. | |
| 47682 | + reasonByteLength = Buffer.byteLength(reason) | |
| 47683 | + | |
| 47684 | + if (reasonByteLength > 123) { | |
| 47685 | + throw new DOMException( | |
| 47686 | + `Reason must be less than 123 bytes; received ${reasonByteLength}`, | |
| 47687 | + 'SyntaxError' | |
| 47688 | + ) | |
| 47689 | + } | |
| 47690 | + } | |
| 47691 | + | |
| 47692 | + // 3. Run the first matching steps from the following list: | |
| 47693 | + if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { | |
| 47694 | + // If this's ready state is CLOSING (2) or CLOSED (3) | |
| 47695 | + // Do nothing. | |
| 47696 | + } else if (!isEstablished(this)) { | |
| 47697 | + // If the WebSocket connection is not yet established | |
| 47698 | + // Fail the WebSocket connection and set this's ready state | |
| 47699 | + // to CLOSING (2). | |
| 47700 | + failWebsocketConnection(this, 'Connection was closed before it was established.') | |
| 47701 | + this[kReadyState] = WebSocket.CLOSING | |
| 47702 | + } else if (!isClosing(this)) { | |
| 47703 | + // If the WebSocket closing handshake has not yet been started | |
| 47704 | + // Start the WebSocket closing handshake and set this's ready | |
| 47705 | + // state to CLOSING (2). | |
| 47706 | + // - If neither code nor reason is present, the WebSocket Close | |
| 47707 | + // message must not have a body. | |
| 47708 | + // - If code is present, then the status code to use in the | |
| 47709 | + // WebSocket Close message must be the integer given by code. | |
| 47710 | + // - If reason is also present, then reasonBytes must be | |
| 47711 | + // provided in the Close message after the status code. | |
| 47712 | + | |
| 47713 | + const frame = new WebsocketFrameSend() | |
| 47714 | + | |
| 47715 | + // If neither code nor reason is present, the WebSocket Close | |
| 47716 | + // message must not have a body. | |
| 47717 | + | |
| 47718 | + // If code is present, then the status code to use in the | |
| 47719 | + // WebSocket Close message must be the integer given by code. | |
| 47720 | + if (code !== undefined && reason === undefined) { | |
| 47721 | + frame.frameData = Buffer.allocUnsafe(2) | |
| 47722 | + frame.frameData.writeUInt16BE(code, 0) | |
| 47723 | + } else if (code !== undefined && reason !== undefined) { | |
| 47724 | + // If reason is also present, then reasonBytes must be | |
| 47725 | + // provided in the Close message after the status code. | |
| 47726 | + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) | |
| 47727 | + frame.frameData.writeUInt16BE(code, 0) | |
| 47728 | + // the body MAY contain UTF-8-encoded data with value /reason/ | |
| 47729 | + frame.frameData.write(reason, 2, 'utf-8') | |
| 47730 | + } else { | |
| 47731 | + frame.frameData = emptyBuffer | |
| 47732 | + } | |
| 47733 | + | |
| 47734 | + /** @type {import('stream').Duplex} */ | |
| 47735 | + const socket = this[kResponse].socket | |
| 47736 | + | |
| 47737 | + socket.write(frame.createFrame(opcodes.CLOSE), (err) => { | |
| 47738 | + if (!err) { | |
| 47739 | + this[kSentClose] = true | |
| 47740 | + } | |
| 47741 | + }) | |
| 47742 | + | |
| 47743 | + // Upon either sending or receiving a Close control frame, it is said | |
| 47744 | + // that _The WebSocket Closing Handshake is Started_ and that the | |
| 47745 | + // WebSocket connection is in the CLOSING state. | |
| 47746 | + this[kReadyState] = states.CLOSING | |
| 47747 | + } else { | |
| 47748 | + // Otherwise | |
| 47749 | + // Set this's ready state to CLOSING (2). | |
| 47750 | + this[kReadyState] = WebSocket.CLOSING | |
| 47751 | + } | |
| 47752 | + } | |
| 47753 | + | |
| 47754 | + /** | |
| 47755 | + * @see https://websockets.spec.whatwg.org/#dom-websocket-send | |
| 47756 | + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | |
| 47757 | + */ | |
| 47758 | + send (data) { | |
| 47759 | + webidl.brandCheck(this, WebSocket) | |
| 47760 | + | |
| 47761 | + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) | |
| 47762 | + | |
| 47763 | + data = webidl.converters.WebSocketSendData(data) | |
| 47764 | + | |
| 47765 | + // 1. If this's ready state is CONNECTING, then throw an | |
| 47766 | + // "InvalidStateError" DOMException. | |
| 47767 | + if (this[kReadyState] === WebSocket.CONNECTING) { | |
| 47768 | + throw new DOMException('Sent before connected.', 'InvalidStateError') | |
| 47769 | + } | |
| 47770 | + | |
| 47771 | + // 2. Run the appropriate set of steps from the following list: | |
| 47772 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 | |
| 47773 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 | |
| 47774 | + | |
| 47775 | + if (!isEstablished(this) || isClosing(this)) { | |
| 47776 | + return | |
| 47777 | + } | |
| 47778 | + | |
| 47779 | + /** @type {import('stream').Duplex} */ | |
| 47780 | + const socket = this[kResponse].socket | |
| 47781 | + | |
| 47782 | + // If data is a string | |
| 47783 | + if (typeof data === 'string') { | |
| 47784 | + // If the WebSocket connection is established and the WebSocket | |
| 47785 | + // closing handshake has not yet started, then the user agent | |
| 47786 | + // must send a WebSocket Message comprised of the data argument | |
| 47787 | + // using a text frame opcode; if the data cannot be sent, e.g. | |
| 47788 | + // because it would need to be buffered but the buffer is full, | |
| 47789 | + // the user agent must flag the WebSocket as full and then close | |
| 47790 | + // the WebSocket connection. Any invocation of this method with a | |
| 47791 | + // string argument that does not throw an exception must increase | |
| 47792 | + // the bufferedAmount attribute by the number of bytes needed to | |
| 47793 | + // express the argument as UTF-8. | |
| 47794 | + | |
| 47795 | + const value = Buffer.from(data) | |
| 47796 | + const frame = new WebsocketFrameSend(value) | |
| 47797 | + const buffer = frame.createFrame(opcodes.TEXT) | |
| 47798 | + | |
| 47799 | + this.#bufferedAmount += value.byteLength | |
| 47800 | + socket.write(buffer, () => { | |
| 47801 | + this.#bufferedAmount -= value.byteLength | |
| 47802 | + }) | |
| 47803 | + } else if (types.isArrayBuffer(data)) { | |
| 47804 | + // If the WebSocket connection is established, and the WebSocket | |
| 47805 | + // closing handshake has not yet started, then the user agent must | |
| 47806 | + // send a WebSocket Message comprised of data using a binary frame | |
| 47807 | + // opcode; if the data cannot be sent, e.g. because it would need | |
| 47808 | + // to be buffered but the buffer is full, the user agent must flag | |
| 47809 | + // the WebSocket as full and then close the WebSocket connection. | |
| 47810 | + // The data to be sent is the data stored in the buffer described | |
| 47811 | + // by the ArrayBuffer object. Any invocation of this method with an | |
| 47812 | + // ArrayBuffer argument that does not throw an exception must | |
| 47813 | + // increase the bufferedAmount attribute by the length of the | |
| 47814 | + // ArrayBuffer in bytes. | |
| 47815 | + | |
| 47816 | + const value = Buffer.from(data) | |
| 47817 | + const frame = new WebsocketFrameSend(value) | |
| 47818 | + const buffer = frame.createFrame(opcodes.BINARY) | |
| 47819 | + | |
| 47820 | + this.#bufferedAmount += value.byteLength | |
| 47821 | + socket.write(buffer, () => { | |
| 47822 | + this.#bufferedAmount -= value.byteLength | |
| 47823 | + }) | |
| 47824 | + } else if (ArrayBuffer.isView(data)) { | |
| 47825 | + // If the WebSocket connection is established, and the WebSocket | |
| 47826 | + // closing handshake has not yet started, then the user agent must | |
| 47827 | + // send a WebSocket Message comprised of data using a binary frame | |
| 47828 | + // opcode; if the data cannot be sent, e.g. because it would need to | |
| 47829 | + // be buffered but the buffer is full, the user agent must flag the | |
| 47830 | + // WebSocket as full and then close the WebSocket connection. The | |
| 47831 | + // data to be sent is the data stored in the section of the buffer | |
| 47832 | + // described by the ArrayBuffer object that data references. Any | |
| 47833 | + // invocation of this method with this kind of argument that does | |
| 47834 | + // not throw an exception must increase the bufferedAmount attribute | |
| 47835 | + // by the length of data’s buffer in bytes. | |
| 47836 | + | |
| 47837 | + const ab = Buffer.from(data, data.byteOffset, data.byteLength) | |
| 47838 | + | |
| 47839 | + const frame = new WebsocketFrameSend(ab) | |
| 47840 | + const buffer = frame.createFrame(opcodes.BINARY) | |
| 47841 | + | |
| 47842 | + this.#bufferedAmount += ab.byteLength | |
| 47843 | + socket.write(buffer, () => { | |
| 47844 | + this.#bufferedAmount -= ab.byteLength | |
| 47845 | + }) | |
| 47846 | + } else if (isBlobLike(data)) { | |
| 47847 | + // If the WebSocket connection is established, and the WebSocket | |
| 47848 | + // closing handshake has not yet started, then the user agent must | |
| 47849 | + // send a WebSocket Message comprised of data using a binary frame | |
| 47850 | + // opcode; if the data cannot be sent, e.g. because it would need to | |
| 47851 | + // be buffered but the buffer is full, the user agent must flag the | |
| 47852 | + // WebSocket as full and then close the WebSocket connection. The data | |
| 47853 | + // to be sent is the raw data represented by the Blob object. Any | |
| 47854 | + // invocation of this method with a Blob argument that does not throw | |
| 47855 | + // an exception must increase the bufferedAmount attribute by the size | |
| 47856 | + // of the Blob object’s raw data, in bytes. | |
| 47857 | + | |
| 47858 | + const frame = new WebsocketFrameSend() | |
| 47859 | + | |
| 47860 | + data.arrayBuffer().then((ab) => { | |
| 47861 | + const value = Buffer.from(ab) | |
| 47862 | + frame.frameData = value | |
| 47863 | + const buffer = frame.createFrame(opcodes.BINARY) | |
| 47864 | + | |
| 47865 | + this.#bufferedAmount += value.byteLength | |
| 47866 | + socket.write(buffer, () => { | |
| 47867 | + this.#bufferedAmount -= value.byteLength | |
| 47868 | + }) | |
| 47869 | + }) | |
| 47870 | + } | |
| 47871 | + } | |
| 47872 | + | |
| 47873 | + get readyState () { | |
| 47874 | + webidl.brandCheck(this, WebSocket) | |
| 47875 | + | |
| 47876 | + // The readyState getter steps are to return this's ready state. | |
| 47877 | + return this[kReadyState] | |
| 47878 | + } | |
| 47879 | + | |
| 47880 | + get bufferedAmount () { | |
| 47881 | + webidl.brandCheck(this, WebSocket) | |
| 47882 | + | |
| 47883 | + return this.#bufferedAmount | |
| 47884 | + } | |
| 47885 | + | |
| 47886 | + get url () { | |
| 47887 | + webidl.brandCheck(this, WebSocket) | |
| 47888 | + | |
| 47889 | + // The url getter steps are to return this's url, serialized. | |
| 47890 | + return URLSerializer(this[kWebSocketURL]) | |
| 47891 | + } | |
| 47892 | + | |
| 47893 | + get extensions () { | |
| 47894 | + webidl.brandCheck(this, WebSocket) | |
| 47895 | + | |
| 47896 | + return this.#extensions | |
| 47897 | + } | |
| 47898 | + | |
| 47899 | + get protocol () { | |
| 47900 | + webidl.brandCheck(this, WebSocket) | |
| 47901 | + | |
| 47902 | + return this.#protocol | |
| 47903 | + } | |
| 47904 | + | |
| 47905 | + get onopen () { | |
| 47906 | + webidl.brandCheck(this, WebSocket) | |
| 47907 | + | |
| 47908 | + return this.#events.open | |
| 47909 | + } | |
| 47910 | + | |
| 47911 | + set onopen (fn) { | |
| 47912 | + webidl.brandCheck(this, WebSocket) | |
| 47913 | + | |
| 47914 | + if (this.#events.open) { | |
| 47915 | + this.removeEventListener('open', this.#events.open) | |
| 47916 | + } | |
| 47917 | + | |
| 47918 | + if (typeof fn === 'function') { | |
| 47919 | + this.#events.open = fn | |
| 47920 | + this.addEventListener('open', fn) | |
| 47921 | + } else { | |
| 47922 | + this.#events.open = null | |
| 47923 | + } | |
| 47924 | + } | |
| 47925 | + | |
| 47926 | + get onerror () { | |
| 47927 | + webidl.brandCheck(this, WebSocket) | |
| 47928 | + | |
| 47929 | + return this.#events.error | |
| 47930 | + } | |
| 47931 | + | |
| 47932 | + set onerror (fn) { | |
| 47933 | + webidl.brandCheck(this, WebSocket) | |
| 47934 | + | |
| 47935 | + if (this.#events.error) { | |
| 47936 | + this.removeEventListener('error', this.#events.error) | |
| 47937 | + } | |
| 47938 | + | |
| 47939 | + if (typeof fn === 'function') { | |
| 47940 | + this.#events.error = fn | |
| 47941 | + this.addEventListener('error', fn) | |
| 47942 | + } else { | |
| 47943 | + this.#events.error = null | |
| 47944 | + } | |
| 47945 | + } | |
| 47946 | + | |
| 47947 | + get onclose () { | |
| 47948 | + webidl.brandCheck(this, WebSocket) | |
| 47949 | + | |
| 47950 | + return this.#events.close | |
| 47951 | + } | |
| 47952 | + | |
| 47953 | + set onclose (fn) { | |
| 47954 | + webidl.brandCheck(this, WebSocket) | |
| 47955 | + | |
| 47956 | + if (this.#events.close) { | |
| 47957 | + this.removeEventListener('close', this.#events.close) | |
| 47958 | + } | |
| 47959 | + | |
| 47960 | + if (typeof fn === 'function') { | |
| 47961 | + this.#events.close = fn | |
| 47962 | + this.addEventListener('close', fn) | |
| 47963 | + } else { | |
| 47964 | + this.#events.close = null | |
| 47965 | + } | |
| 47966 | + } | |
| 47967 | + | |
| 47968 | + get onmessage () { | |
| 47969 | + webidl.brandCheck(this, WebSocket) | |
| 47970 | + | |
| 47971 | + return this.#events.message | |
| 47972 | + } | |
| 47973 | + | |
| 47974 | + set onmessage (fn) { | |
| 47975 | + webidl.brandCheck(this, WebSocket) | |
| 47976 | + | |
| 47977 | + if (this.#events.message) { | |
| 47978 | + this.removeEventListener('message', this.#events.message) | |
| 47979 | + } | |
| 47980 | + | |
| 47981 | + if (typeof fn === 'function') { | |
| 47982 | + this.#events.message = fn | |
| 47983 | + this.addEventListener('message', fn) | |
| 47984 | + } else { | |
| 47985 | + this.#events.message = null | |
| 47986 | + } | |
| 47987 | + } | |
| 47988 | + | |
| 47989 | + get binaryType () { | |
| 47990 | + webidl.brandCheck(this, WebSocket) | |
| 47991 | + | |
| 47992 | + return this[kBinaryType] | |
| 47993 | + } | |
| 47994 | + | |
| 47995 | + set binaryType (type) { | |
| 47996 | + webidl.brandCheck(this, WebSocket) | |
| 47997 | + | |
| 47998 | + if (type !== 'blob' && type !== 'arraybuffer') { | |
| 47999 | + this[kBinaryType] = 'blob' | |
| 48000 | + } else { | |
| 48001 | + this[kBinaryType] = type | |
| 48002 | + } | |
| 48003 | + } | |
| 48004 | + | |
| 48005 | + /** | |
| 48006 | + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | |
| 48007 | + */ | |
| 48008 | + #onConnectionEstablished (response) { | |
| 48009 | + // processResponse is called when the "response’s header list has been received and initialized." | |
| 48010 | + // once this happens, the connection is open | |
| 48011 | + this[kResponse] = response | |
| 48012 | + | |
| 48013 | + const parser = new ByteParser(this) | |
| 48014 | + parser.on('drain', function onParserDrain () { | |
| 48015 | + this.ws[kResponse].socket.resume() | |
| 48016 | + }) | |
| 48017 | + | |
| 48018 | + response.socket.ws = this | |
| 48019 | + this[kByteParser] = parser | |
| 48020 | + | |
| 48021 | + // 1. Change the ready state to OPEN (1). | |
| 48022 | + this[kReadyState] = states.OPEN | |
| 48023 | + | |
| 48024 | + // 2. Change the extensions attribute’s value to the extensions in use, if | |
| 48025 | + // it is not the null value. | |
| 48026 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 | |
| 48027 | + const extensions = response.headersList.get('sec-websocket-extensions') | |
| 48028 | + | |
| 48029 | + if (extensions !== null) { | |
| 48030 | + this.#extensions = extensions | |
| 48031 | + } | |
| 48032 | + | |
| 48033 | + // 3. Change the protocol attribute’s value to the subprotocol in use, if | |
| 48034 | + // it is not the null value. | |
| 48035 | + // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 | |
| 48036 | + const protocol = response.headersList.get('sec-websocket-protocol') | |
| 48037 | + | |
| 48038 | + if (protocol !== null) { | |
| 48039 | + this.#protocol = protocol | |
| 48040 | + } | |
| 48041 | + | |
| 48042 | + // 4. Fire an event named open at the WebSocket object. | |
| 48043 | + fireEvent('open', this) | |
| 48044 | + } | |
| 48045 | +} | |
| 48046 | + | |
| 48047 | +// https://websockets.spec.whatwg.org/#dom-websocket-connecting | |
| 48048 | +WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING | |
| 48049 | +// https://websockets.spec.whatwg.org/#dom-websocket-open | |
| 48050 | +WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN | |
| 48051 | +// https://websockets.spec.whatwg.org/#dom-websocket-closing | |
| 48052 | +WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING | |
| 48053 | +// https://websockets.spec.whatwg.org/#dom-websocket-closed | |
| 48054 | +WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED | |
| 48055 | + | |
| 48056 | +Object.defineProperties(WebSocket.prototype, { | |
| 48057 | + CONNECTING: staticPropertyDescriptors, | |
| 48058 | + OPEN: staticPropertyDescriptors, | |
| 48059 | + CLOSING: staticPropertyDescriptors, | |
| 48060 | + CLOSED: staticPropertyDescriptors, | |
| 48061 | + url: kEnumerableProperty, | |
| 48062 | + readyState: kEnumerableProperty, | |
| 48063 | + bufferedAmount: kEnumerableProperty, | |
| 48064 | + onopen: kEnumerableProperty, | |
| 48065 | + onerror: kEnumerableProperty, | |
| 48066 | + onclose: kEnumerableProperty, | |
| 48067 | + close: kEnumerableProperty, | |
| 48068 | + onmessage: kEnumerableProperty, | |
| 48069 | + binaryType: kEnumerableProperty, | |
| 48070 | + send: kEnumerableProperty, | |
| 48071 | + extensions: kEnumerableProperty, | |
| 48072 | + protocol: kEnumerableProperty, | |
| 48073 | + [Symbol.toStringTag]: { | |
| 48074 | + value: 'WebSocket', | |
| 48075 | + writable: false, | |
| 48076 | + enumerable: false, | |
| 48077 | + configurable: true | |
| 48078 | + } | |
| 48079 | +}) | |
| 48080 | + | |
| 48081 | +Object.defineProperties(WebSocket, { | |
| 48082 | + CONNECTING: staticPropertyDescriptors, | |
| 48083 | + OPEN: staticPropertyDescriptors, | |
| 48084 | + CLOSING: staticPropertyDescriptors, | |
| 48085 | + CLOSED: staticPropertyDescriptors | |
| 48086 | +}) | |
| 48087 | + | |
| 48088 | +webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter( | |
| 48089 | + webidl.converters.DOMString | |
| 48090 | +) | |
| 48091 | + | |
| 48092 | +webidl.converters['DOMString or sequence<DOMString>'] = function (V) { | |
| 48093 | + if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { | |
| 48094 | + return webidl.converters['sequence<DOMString>'](V) | |
| 48095 | + } | |
| 48096 | + | |
| 48097 | + return webidl.converters.DOMString(V) | |
| 48098 | +} | |
| 48099 | + | |
| 48100 | +// This implements the propsal made in https://github.com/whatwg/websockets/issues/42 | |
| 48101 | +webidl.converters.WebSocketInit = webidl.dictionaryConverter([ | |
| 48102 | + { | |
| 48103 | + key: 'protocols', | |
| 48104 | + converter: webidl.converters['DOMString or sequence<DOMString>'], | |
| 48105 | + get defaultValue () { | |
| 48106 | + return [] | |
| 48107 | + } | |
| 48108 | + }, | |
| 48109 | + { | |
| 48110 | + key: 'dispatcher', | |
| 48111 | + converter: (V) => V, | |
| 48112 | + get defaultValue () { | |
| 48113 | + return getGlobalDispatcher() | |
| 48114 | + } | |
| 48115 | + }, | |
| 48116 | + { | |
| 48117 | + key: 'headers', | |
| 48118 | + converter: webidl.nullableConverter(webidl.converters.HeadersInit) | |
| 48119 | + } | |
| 48120 | +]) | |
| 48121 | + | |
| 48122 | +webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) { | |
| 48123 | + if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { | |
| 48124 | + return webidl.converters.WebSocketInit(V) | |
| 48125 | + } | |
| 48126 | + | |
| 48127 | + return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) } | |
| 48128 | +} | |
| 48129 | + | |
| 48130 | +webidl.converters.WebSocketSendData = function (V) { | |
| 48131 | + if (webidl.util.Type(V) === 'Object') { | |
| 48132 | + if (isBlobLike(V)) { | |
| 48133 | + return webidl.converters.Blob(V, { strict: false }) | |
| 48134 | + } | |
| 48135 | + | |
| 48136 | + if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { | |
| 48137 | + return webidl.converters.BufferSource(V) | |
| 48138 | + } | |
| 48139 | + } | |
| 48140 | + | |
| 48141 | + return webidl.converters.USVString(V) | |
| 48142 | +} | |
| 48143 | + | |
| 48144 | +module.exports = { | |
| 48145 | + WebSocket | |
| 48146 | +} | |
| 48147 | + | |
| 48148 | + | |
| 48149 | +/***/ }), | |
| 48150 | + | |
| 48151 | +/***/ 9890: | |
| 48152 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 48153 | + | |
| 48154 | +const core = __nccwpck_require__(7484) | |
| 48155 | +const { exec } = __nccwpck_require__(5236) | |
| 48156 | +const tc = __nccwpck_require__(3472) | |
| 48157 | +const path = __nccwpck_require__(6928) | |
| 48158 | +const semver = __nccwpck_require__(2088) | |
| 48159 | +const fs = __nccwpck_require__(9896) | |
| 48160 | +const os = __nccwpck_require__(857) | |
| 48161 | +const csv = __nccwpck_require__(1110) | |
| 48162 | +const _ = __nccwpck_require__(2356) | |
| 48163 | + | |
| 48164 | +const MAX_HTTP_RETRIES = 3 | |
| 48165 | + | |
| 48166 | +if (process.env.NODE_ENV !== 'test') { | |
| 48167 | + main().catch((err) => { | |
| 48168 | + core.setFailed(err.message) | |
| 48169 | + }) | |
| 48170 | +} | |
| 48171 | + | |
| 48172 | +async function main() { | |
| 48173 | + checkOtpArchitecture() | |
| 48174 | + | |
| 48175 | + const versionFilePath = getInput('version-file', false) | |
| 48176 | + let versions | |
| 48177 | + if (versionFilePath) { | |
| 48178 | + if (!isStrictVersion()) { | |
| 48179 | + throw new Error( | |
| 48180 | + "you have to set version-type=strict if you're using version-file", | |
| 48181 | + ) | |
| 48182 | + } | |
| 48183 | + versions = parseVersionFile(versionFilePath) | |
| 48184 | + } | |
| 48185 | + | |
| 48186 | + const otpSpec = getInput('otp-version', true, 'erlang', versions) | |
| 48187 | + const elixirSpec = getInput('elixir-version', false, 'elixir', versions) | |
| 48188 | + const gleamSpec = getInput('gleam-version', false, 'gleam', versions) | |
| 48189 | + const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions) | |
| 48190 | + | |
| 48191 | + if (otpSpec !== 'false') { | |
| 48192 | + await installOTP(otpSpec) | |
| 48193 | + const elixirInstalled = await maybeInstallElixir(elixirSpec) | |
| 48194 | + if (elixirInstalled === true) { | |
| 48195 | + const shouldMixRebar = getInput('install-rebar', false) | |
| 48196 | + await mix(shouldMixRebar, 'rebar') | |
| 48197 | + | |
| 48198 | + const shouldMixHex = getInput('install-hex', false) | |
| 48199 | + await mix(shouldMixHex, 'hex') | |
| 48200 | + } | |
| 48201 | + } else if (!gleamSpec) { | |
| 48202 | + throw new Error('otp-version=false is only available when installing Gleam') | |
| 48203 | + } | |
| 48204 | + | |
| 48205 | + await maybeInstallGleam(gleamSpec) | |
| 48206 | + await maybeInstallRebar3(rebar3Spec) | |
| 48207 | + | |
| 48208 | + // undefined is replaced by a function, post- main branch merge | |
| 48209 | + const setupBeamVersion = 'a50e3e2' | |
| 48210 | + core.setOutput('setup-beam-version', setupBeamVersion) | |
| 48211 | +} | |
| 48212 | + | |
| 48213 | +async function installOTP(otpSpec) { | |
| 48214 | + const osVersion = getRunnerOSVersion() | |
| 48215 | + const otpVersion = await getOTPVersion(otpSpec, osVersion) | |
| 48216 | + core.startGroup( | |
| 48217 | + `Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`, | |
| 48218 | + ) | |
| 48219 | + await doWithMirrors({ | |
| 48220 | + hexMirrors: hexMirrorsInput(), | |
| 48221 | + actionTitle: `install Erlang/OTP ${otpVersion}`, | |
| 48222 | + action: async (hexMirror) => { | |
| 48223 | + await install('otp', { | |
| 48224 | + osVersion, | |
| 48225 | + toolVersion: otpVersion, | |
| 48226 | + hexMirror, | |
| 48227 | + }) | |
| 48228 | + }, | |
| 48229 | + }) | |
| 48230 | + core.setOutput('otp-version', otpVersion) | |
| 48231 | + core.endGroup() | |
| 48232 | + | |
| 48233 | + return otpVersion | |
| 48234 | +} | |
| 48235 | + | |
| 48236 | +async function maybeInstallElixir(elixirSpec) { | |
| 48237 | + let installed = false | |
| 48238 | + if (elixirSpec) { | |
| 48239 | + const elixirVersion = await getElixirVersion(elixirSpec) | |
| 48240 | + core.startGroup(`Installing Elixir ${elixirVersion}`) | |
| 48241 | + await doWithMirrors({ | |
| 48242 | + hexMirrors: hexMirrorsInput(), | |
| 48243 | + actionTitle: `install Elixir ${elixirVersion}`, | |
| 48244 | + action: async (hexMirror) => { | |
| 48245 | + await install('elixir', { | |
| 48246 | + toolVersion: elixirVersion, | |
| 48247 | + hexMirror, | |
| 48248 | + }) | |
| 48249 | + }, | |
| 48250 | + }) | |
| 48251 | + core.setOutput('elixir-version', elixirVersion) | |
| 48252 | + maybeEnableElixirProblemMatchers() | |
| 48253 | + core.endGroup() | |
| 48254 | + | |
| 48255 | + installed = true | |
| 48256 | + } | |
| 48257 | + | |
| 48258 | + return installed | |
| 48259 | +} | |
| 48260 | + | |
| 48261 | +function maybeEnableElixirProblemMatchers() { | |
| 48262 | + const disableProblemMatchers = getInput('disable_problem_matchers', false) | |
| 48263 | + if (disableProblemMatchers === 'false') { | |
| 48264 | + const elixirMatchers = __nccwpck_require__.ab + "elixir-matchers.json" | |
| 48265 | + core.info(`##[add-matcher]${elixirMatchers}`) | |
| 48266 | + } | |
| 48267 | +} | |
| 48268 | + | |
| 48269 | +async function mix(shouldMix, what) { | |
| 48270 | + if (shouldMix === 'true') { | |
| 48271 | + const cmd = 'mix' | |
| 48272 | + const args = [`local.${what}`, '--force'] | |
| 48273 | + core.startGroup(`Running ${cmd} ${args}`) | |
| 48274 | + await doWithMirrors({ | |
| 48275 | + hexMirrors: hexMirrorsInput(), | |
| 48276 | + actionTitle: `mix ${what}`, | |
| 48277 | + action: async (hexMirror) => { | |
| 48278 | + process.env.HEX_MIRROR = hexMirror | |
| 48279 | + await exec(cmd, args) | |
| 48280 | + }, | |
| 48281 | + }) | |
| 48282 | + core.endGroup() | |
| 48283 | + } | |
| 48284 | +} | |
| 48285 | + | |
| 48286 | +async function maybeInstallGleam(gleamSpec) { | |
| 48287 | + let installed = false | |
| 48288 | + if (gleamSpec) { | |
| 48289 | + const gleamVersion = await getGleamVersion(gleamSpec) | |
| 48290 | + core.startGroup(`Installing Gleam ${gleamVersion}`) | |
| 48291 | + await install('gleam', { toolVersion: gleamVersion }) | |
| 48292 | + core.setOutput('gleam-version', gleamVersion) | |
| 48293 | + core.endGroup() | |
| 48294 | + | |
| 48295 | + installed = true | |
| 48296 | + } | |
| 48297 | + | |
| 48298 | + return installed | |
| 48299 | +} | |
| 48300 | + | |
| 48301 | +async function maybeInstallRebar3(rebar3Spec) { | |
| 48302 | + let installed = false | |
| 48303 | + let rebar3Version | |
| 48304 | + if (rebar3Spec) { | |
| 48305 | + if (rebar3Spec === 'nightly') { | |
| 48306 | + rebar3Version = 'nightly' | |
| 48307 | + } else { | |
| 48308 | + rebar3Version = await getRebar3Version(rebar3Spec) | |
| 48309 | + } | |
| 48310 | + core.startGroup(`Installing rebar3 ${rebar3Version}`) | |
| 48311 | + await install('rebar3', { toolVersion: rebar3Version }) | |
| 48312 | + core.setOutput('rebar3-version', rebar3Version) | |
| 48313 | + core.endGroup() | |
| 48314 | + | |
| 48315 | + installed = true | |
| 48316 | + } | |
| 48317 | + | |
| 48318 | + return installed | |
| 48319 | +} | |
| 48320 | + | |
| 48321 | +function maybeRemoveOTPPrefix(otpSpec) { | |
| 48322 | + return otpSpec.replace(/^OTP-/, '') | |
| 48323 | +} | |
| 48324 | + | |
| 48325 | +async function getOTPVersion(otpSpec0, osVersion) { | |
| 48326 | + const [otpVersions, originListing, hexMirrors] = | |
| 48327 | + await getOTPVersions(osVersion) | |
| 48328 | + let spec = maybeRemoveOTPPrefix(otpSpec0) | |
| 48329 | + const versions = otpVersions | |
| 48330 | + const otpVersion = getVersionFromSpec(spec, versions) | |
| 48331 | + | |
| 48332 | + if (otpVersion === null) { | |
| 48333 | + throw new Error( | |
| 48334 | + requestedVersionFor('Erlang/OTP', otpSpec0, originListing, hexMirrors), | |
| 48335 | + ) | |
| 48336 | + } | |
| 48337 | + | |
| 48338 | + return otpVersion // from the reference, for download | |
| 48339 | +} | |
| 48340 | + | |
| 48341 | +function requestedVersionFor(tool, version, originListing, mirrors) { | |
| 48342 | + const isStrictVersion = isStrictVersion() | |
| 48343 | + | |
| 48344 | + let versionType = 'loose' | |
| 48345 | + if (isStrictVersion) { | |
| 48346 | + versionType = 'strict' | |
| 48347 | + } | |
| 48348 | + | |
| 48349 | + let ret = | |
| 48350 | + `Requested ${versionType} ${tool} version (${version}) not found in version list, ` + | |
| 48351 | + `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.` | |
| 48352 | + if (!isStrictVersion) { | |
| 48353 | + ret = `${ret} Should you be using option 'version-type': 'strict'?` | |
| 48354 | + } | |
| 48355 | + | |
| 48356 | + return ret | |
| 48357 | +} | |
| 48358 | + | |
| 48359 | +const knownBranches = ['main', 'master', 'maint'] | |
| 48360 | +const nonSpecificVersions = ['nightly', 'latest'] | |
| 48361 | + | |
| 48362 | +async function getElixirVersion(exSpec0) { | |
| 48363 | + const otpSuffix = /-otp-(\d+)/ | |
| 48364 | + const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null | |
| 48365 | + let otpVersionMajor = '' | |
| 48366 | + | |
| 48367 | + if (userSuppliedOtp && isVersion(userSuppliedOtp)) { | |
| 48368 | + otpVersionMajor = userSuppliedOtp | |
| 48369 | + } else { | |
| 48370 | + let cmd = 'erl' | |
| 48371 | + if (process.platform === 'win32') { | |
| 48372 | + cmd = 'erl.exe' | |
| 48373 | + } | |
| 48374 | + const args = [ | |
| 48375 | + '-noshell', | |
| 48376 | + '-eval', | |
| 48377 | + 'io:format(erlang:system_info(otp_release)), halt().', | |
| 48378 | + ] | |
| 48379 | + await exec(cmd, args, { | |
| 48380 | + listeners: { | |
| 48381 | + stdout: (data) => { | |
| 48382 | + otpVersionMajor = data.toString() | |
| 48383 | + }, | |
| 48384 | + }, | |
| 48385 | + }) | |
| 48386 | + } | |
| 48387 | + | |
| 48388 | + const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] = | |
| 48389 | + await getElixirVersions() | |
| 48390 | + const spec = exSpec0.replace(otpSuffix, '') | |
| 48391 | + const versions = elixirVersions | |
| 48392 | + const elixirVersionFromSpec = getVersionFromSpec(spec, versions) | |
| 48393 | + | |
| 48394 | + if (elixirVersionFromSpec === null) { | |
| 48395 | + throw new Error( | |
| 48396 | + requestedVersionFor('Elixir', exSpec0, originListing, hexMirrors), | |
| 48397 | + ) | |
| 48398 | + } | |
| 48399 | + | |
| 48400 | + let foundCombo = false | |
| 48401 | + let otpVersionMajorIter = parseInt(otpVersionMajor) | |
| 48402 | + let otpVersionsMajor = [] | |
| 48403 | + while (otpVersionMajorIter > otpVersionMajor - 3) { | |
| 48404 | + otpVersionMajorIter += '' | |
| 48405 | + otpVersionsMajor.push(otpVersionMajorIter) | |
| 48406 | + const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec] | |
| 48407 | + if ( | |
| 48408 | + (elixirVersionComp && elixirVersionComp.includes(otpVersionMajorIter)) || | |
| 48409 | + !isVersion(otpVersionMajorIter) | |
| 48410 | + ) { | |
| 48411 | + core.info( | |
| 48412 | + `Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajorIter})`, | |
| 48413 | + ) | |
| 48414 | + foundCombo = true | |
| 48415 | + break | |
| 48416 | + } | |
| 48417 | + otpVersionMajorIter = parseInt(otpVersionMajorIter) - 1 | |
| 48418 | + } | |
| 48419 | + | |
| 48420 | + if (!foundCombo) { | |
| 48421 | + throw new Error( | |
| 48422 | + `Requested Elixir / Erlang/OTP version (${exSpec0} / tried ${otpVersionsMajor}) not ` + | |
| 48423 | + 'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' + | |
| 48424 | + 'Elixir and Erlang/OTP compatibility can be found at: ' + | |
| 48425 | + 'https://hexdocs.pm/elixir/compatibility-and-deprecations.html', | |
| 48426 | + ) | |
| 48427 | + } | |
| 48428 | + | |
| 48429 | + let elixirVersionForDownload = elixirVersionFromSpec | |
| 48430 | + | |
| 48431 | + if (isVersion(otpVersionMajorIter)) { | |
| 48432 | + elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajorIter}` | |
| 48433 | + } | |
| 48434 | + | |
| 48435 | + return maybePrependWithV(elixirVersionForDownload) | |
| 48436 | +} | |
| 48437 | + | |
| 48438 | +async function getGleamVersion(gleamSpec0) { | |
| 48439 | + const [gleamVersions, originListing] = await getGleamVersions() | |
| 48440 | + const spec = gleamSpec0 | |
| 48441 | + const versions = gleamVersions | |
| 48442 | + const gleamVersion = getVersionFromSpec(spec, versions) | |
| 48443 | + | |
| 48444 | + if (gleamVersion === null) { | |
| 48445 | + throw new Error(requestedVersionFor('Gleam', gleamSpec0, originListing)) | |
| 48446 | + } | |
| 48447 | + | |
| 48448 | + return maybePrependWithV(gleamVersion) | |
| 48449 | +} | |
| 48450 | + | |
| 48451 | +async function getRebar3Version(r3Spec) { | |
| 48452 | + const [rebar3Versions, originListing] = await getRebar3Versions() | |
| 48453 | + const spec = r3Spec | |
| 48454 | + const versions = rebar3Versions | |
| 48455 | + const rebar3Version = getVersionFromSpec(spec, versions) | |
| 48456 | + | |
| 48457 | + if (rebar3Version === null) { | |
| 48458 | + throw new Error(requestedVersionFor('rebar3', r3Spec, originListing)) | |
| 48459 | + } | |
| 48460 | + | |
| 48461 | + return rebar3Version | |
| 48462 | +} | |
| 48463 | + | |
| 48464 | +function otpArchitecture() { | |
| 48465 | + return getInput('otp-architecture', false) | |
| 48466 | +} | |
| 48467 | + | |
| 48468 | +async function getOTPVersions(osVersion) { | |
| 48469 | + let otpVersionsListings | |
| 48470 | + let originListing | |
| 48471 | + let hexMirrors = null | |
| 48472 | + if (process.platform === 'linux') { | |
| 48473 | + originListing = `/builds/otp/${getRunnerOSArchitecture()}/${osVersion}/builds.txt` | |
| 48474 | + hexMirrors = hexMirrorsInput() | |
| 48475 | + otpVersionsListings = await doWithMirrors({ | |
| 48476 | + hexMirrors, | |
| 48477 | + actionTitle: `fetch ${originListing}`, | |
| 48478 | + action: async (hexMirror) => { | |
| 48479 | + return get(`${hexMirror}${originListing}`) | |
| 48480 | + }, | |
| 48481 | + }) | |
| 48482 | + } else if (process.platform === 'win32') { | |
| 48483 | + originListing = | |
| 48484 | + 'https://api.github.com/repos/erlang/otp/releases?per_page=100' | |
| 48485 | + otpVersionsListings = await get(originListing, [1, 2, 3]) | |
| 48486 | + } else if (process.platform === 'darwin') { | |
| 48487 | + const arch = getRunnerOSArchitecture() | |
| 48488 | + let targetArch | |
| 48489 | + switch (arch) { | |
| 48490 | + case 'amd64': | |
| 48491 | + targetArch = 'x86_64' | |
| 48492 | + break | |
| 48493 | + case 'arm64': | |
| 48494 | + targetArch = 'aarch64' | |
| 48495 | + break | |
| 48496 | + } | |
| 48497 | + originListing = | |
| 48498 | + `https://raw.githubusercontent.com/erlef/otp_builds/refs/heads/main` + | |
| 48499 | + `/builds/${targetArch}-apple-darwin.csv` | |
| 48500 | + otpVersionsListings = await get(originListing) | |
| 48501 | + } | |
| 48502 | + | |
| 48503 | + debugLog( | |
| 48504 | + `OTP versions listings from ${originListing}, mirrors ${hexMirrors}`, | |
| 48505 | + otpVersionsListings, | |
| 48506 | + ) | |
| 48507 | + | |
| 48508 | + const otpVersions = {} | |
| 48509 | + if (process.platform === 'linux') { | |
| 48510 | + otpVersionsListings | |
| 48511 | + .trim() | |
| 48512 | + .split('\n') | |
| 48513 | + .forEach((line) => { | |
| 48514 | + const otpVersionOrig = line.match(/^([^ ]+)?( .+)/)[1] | |
| 48515 | + const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig) | |
| 48516 | + debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig]) | |
| 48517 | + otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference | |
| 48518 | + }) | |
| 48519 | + } else if (process.platform === 'win32') { | |
| 48520 | + const otpArch = otpArchitecture() | |
| 48521 | + const file_regex = new RegExp( | |
| 48522 | + `^otp_win${_.escapeRegExp(otpArch)}_(.*).exe$`, | |
| 48523 | + ) | |
| 48524 | + otpVersionsListings.forEach((otpVersionsListing) => { | |
| 48525 | + otpVersionsListing | |
| 48526 | + .map((x) => x.assets) | |
| 48527 | + .flat() | |
| 48528 | + .filter((x) => x.name.match(file_regex)) | |
| 48529 | + .forEach((x) => { | |
| 48530 | + const otpVersionOrig = x.name.match(file_regex)[1] | |
| 48531 | + const otpVersion = otpVersionOrig | |
| 48532 | + debugLog('OTP line and parsing', [x.name, otpVersion, otpVersionOrig]) | |
| 48533 | + otpVersions[otpVersion] = otpVersionOrig | |
| 48534 | + }) | |
| 48535 | + }) | |
| 48536 | + } else if (process.platform === 'darwin') { | |
| 48537 | + csv | |
| 48538 | + .parse(otpVersionsListings, { | |
| 48539 | + columns: true, | |
| 48540 | + }) | |
| 48541 | + .forEach((line) => { | |
| 48542 | + const otpVersionOrig = line.ref_name | |
| 48543 | + const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig) | |
| 48544 | + debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig]) | |
| 48545 | + otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference | |
| 48546 | + }) | |
| 48547 | + } | |
| 48548 | + | |
| 48549 | + debugLog( | |
| 48550 | + `OTP versions from ${originListing}, mirrors ${hexMirrors}`, | |
| 48551 | + JSON.stringify(otpVersions), | |
| 48552 | + ) | |
| 48553 | + | |
| 48554 | + return [otpVersions, originListing, hexMirrors] | |
| 48555 | +} | |
| 48556 | + | |
| 48557 | +async function getElixirVersions() { | |
| 48558 | + const originListing = '/builds/elixir/builds.txt' | |
| 48559 | + const hexMirrors = hexMirrorsInput() | |
| 48560 | + const elixirVersionsListings = await doWithMirrors({ | |
| 48561 | + hexMirrors, | |
| 48562 | + actionTitle: `fetch ${originListing}`, | |
| 48563 | + action: async (hexMirror) => { | |
| 48564 | + return get(`${hexMirror}${originListing}`) | |
| 48565 | + }, | |
| 48566 | + }) | |
| 48567 | + const otpVersionsForElixirMap = {} | |
| 48568 | + const elixirVersions = {} | |
| 48569 | + | |
| 48570 | + elixirVersionsListings | |
| 48571 | + .trim() | |
| 48572 | + .split('\n') | |
| 48573 | + .forEach((line) => { | |
| 48574 | + const elixirMatch = | |
| 48575 | + line.match(/^v?(.+)-otp-([^ ]+)/) || line.match(/^v?([^ ]+)/) | |
| 48576 | + const elixirVersion = elixirMatch[1] | |
| 48577 | + const otpVersion = elixirMatch[2] | |
| 48578 | + const otpVersions = otpVersionsForElixirMap[elixirVersion] || [] | |
| 48579 | + if (otpVersion) { | |
| 48580 | + // -otp- present (special case) | |
| 48581 | + otpVersions.push(otpVersion) | |
| 48582 | + } | |
| 48583 | + otpVersionsForElixirMap[elixirVersion] = otpVersions | |
| 48584 | + elixirVersions[elixirVersion] = elixirVersion | |
| 48585 | + }) | |
| 48586 | + | |
| 48587 | + return [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] | |
| 48588 | +} | |
| 48589 | + | |
| 48590 | +async function getGleamVersions() { | |
| 48591 | + const originListing = | |
| 48592 | + 'https://api.github.com/repos/gleam-lang/gleam/releases?per_page=100' | |
| 48593 | + const resultJSONs = await get(originListing, [1, 2, 3]) | |
| 48594 | + const gleamVersionsListing = {} | |
| 48595 | + resultJSONs.forEach((resultJSON) => { | |
| 48596 | + resultJSON | |
| 48597 | + .map((x) => x.tag_name) | |
| 48598 | + .forEach((ver) => { | |
| 48599 | + const gleamMatch = ver.match(/^v?([^ ]+)/) | |
| 48600 | + const gleamVersion = gleamMatch[1] | |
| 48601 | + gleamVersionsListing[gleamVersion] = gleamVersion | |
| 48602 | + }) | |
| 48603 | + }) | |
| 48604 | + | |
| 48605 | + return [gleamVersionsListing, originListing] | |
| 48606 | +} | |
| 48607 | + | |
| 48608 | +async function getRebar3Versions() { | |
| 48609 | + const originListing = | |
| 48610 | + 'https://api.github.com/repos/erlang/rebar3/releases?per_page=100' | |
| 48611 | + const resultJSONs = await get(originListing, [1, 2, 3]) | |
| 48612 | + const rebar3VersionsListing = {} | |
| 48613 | + resultJSONs.forEach((resultJSON) => { | |
| 48614 | + resultJSON | |
| 48615 | + .map((x) => x.tag_name) | |
| 48616 | + .forEach((ver) => { | |
| 48617 | + rebar3VersionsListing[ver] = ver | |
| 48618 | + }) | |
| 48619 | + }) | |
| 48620 | + | |
| 48621 | + return [rebar3VersionsListing, originListing] | |
| 48622 | +} | |
| 48623 | + | |
| 48624 | +function isStrictVersion() { | |
| 48625 | + return getInput('version-type', false) === 'strict' | |
| 48626 | +} | |
| 48627 | + | |
| 48628 | +function gt(left, right) { | |
| 48629 | + return semver.gt(parseVersion(left), parseVersion(right)) | |
| 48630 | +} | |
| 48631 | + | |
| 48632 | +function validVersion(v) { | |
| 48633 | + return ( | |
| 48634 | + v.match( | |
| 48635 | + new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`), | |
| 48636 | + ) == null && | |
| 48637 | + // these ones are for rebar3, which has alpha and beta releases | |
| 48638 | + !v.startsWith('a') && | |
| 48639 | + !v.startsWith('b') | |
| 48640 | + ) | |
| 48641 | +} | |
| 48642 | + | |
| 48643 | +function parseVersion(v) { | |
| 48644 | + v = v.includes('rc') ? v : v.split('.') | |
| 48645 | + if (v instanceof Array) { | |
| 48646 | + v = `${[v.shift(), v.shift(), v.shift()].join('.')}+${v.join('.')}` | |
| 48647 | + } | |
| 48648 | + return semver.coerce(v, { includePrerelease: true, loose: true }) | |
| 48649 | +} | |
| 48650 | + | |
| 48651 | +function getVersionFromSpec(spec0, versions0) { | |
| 48652 | + let latest | |
| 48653 | + Object.keys(versions0).forEach((v) => { | |
| 48654 | + if (validVersion(v)) { | |
| 48655 | + latest = latest && gt(latest, v) ? latest : v | |
| 48656 | + } | |
| 48657 | + }) | |
| 48658 | + versions0.latest = latest | |
| 48659 | + const spec = maybeRemoveVPrefix(spec0) | |
| 48660 | + | |
| 48661 | + const altVersions = {} | |
| 48662 | + Object.entries(versions0).forEach(([version, altVersion]) => { | |
| 48663 | + let coerced | |
| 48664 | + if ( | |
| 48665 | + isStrictVersion() || | |
| 48666 | + isRC(version) || | |
| 48667 | + isKnownBranch(version) || | |
| 48668 | + isKnownVerBranch(version) | |
| 48669 | + ) { | |
| 48670 | + // If `version-type: strict`, version is an RC, or version is "a branch" | |
| 48671 | + // we just try to remove a potential initial v | |
| 48672 | + coerced = maybeRemoveVPrefix(version) | |
| 48673 | + } else { | |
| 48674 | + // Otherwise, we place the version into a version bucket | |
| 48675 | + coerced = maybeCoerced(version) | |
| 48676 | + } | |
| 48677 | + const alt = (altVersions[coerced] || []).concat(altVersion) | |
| 48678 | + alt.sort(sortVersions) | |
| 48679 | + altVersions[coerced] = alt | |
| 48680 | + }) | |
| 48681 | + | |
| 48682 | + let versions = Object.keys(altVersions) | |
| 48683 | + | |
| 48684 | + const rangeForMax = semver.validRange(spec0) || maybeCoerced(spec) | |
| 48685 | + const rangeMax = semver.maxSatisfying(versions, rangeForMax) | |
| 48686 | + let version = null | |
| 48687 | + | |
| 48688 | + if (spec0 === 'latest') { | |
| 48689 | + version = versions0[versions0.latest] | |
| 48690 | + } else if ( | |
| 48691 | + isStrictVersion() || | |
| 48692 | + isRC(spec0) || | |
| 48693 | + isKnownBranch(spec0) || | |
| 48694 | + isKnownVerBranch(spec0) || | |
| 48695 | + spec0 === 'nightly' | |
| 48696 | + ) { | |
| 48697 | + if (versions0[spec]) { | |
| 48698 | + // We obtain it directly | |
| 48699 | + version = versions0[spec] | |
| 48700 | + } | |
| 48701 | + } else if (rangeMax !== null) { | |
| 48702 | + // Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest | |
| 48703 | + const thatVersion = spec | |
| 48704 | + const thatVersionAbc = versionAbc(thatVersion) | |
| 48705 | + const thatVersionAbcRange = semver.validRange(thatVersionAbc) | |
| 48706 | + | |
| 48707 | + versions = altVersions[rangeMax] | |
| 48708 | + for (let i = versions.length - 1; i >= 0; i -= 1) { | |
| 48709 | + const thisVersion = versions[i] | |
| 48710 | + const thisVersionAbc = versionAbc(thisVersion) | |
| 48711 | + const thisVersionAbcRange = semver.validRange(thisVersionAbc) | |
| 48712 | + | |
| 48713 | + if ( | |
| 48714 | + thatVersionAbcRange && | |
| 48715 | + semver.intersects(thatVersionAbcRange, thisVersionAbcRange) | |
| 48716 | + ) { | |
| 48717 | + version = thisVersion | |
| 48718 | + break | |
| 48719 | + } | |
| 48720 | + } | |
| 48721 | + } | |
| 48722 | + | |
| 48723 | + return version || null | |
| 48724 | +} | |
| 48725 | + | |
| 48726 | +function maybeCoerced(v) { | |
| 48727 | + let ret | |
| 48728 | + try { | |
| 48729 | + if (!isRC(v)) { | |
| 48730 | + ret = semver.coerce(v).version | |
| 48731 | + } else { | |
| 48732 | + ret = maybeRemoveVPrefix(v) | |
| 48733 | + } | |
| 48734 | + } catch { | |
| 48735 | + // some stuff can't be coerced, like 'main' | |
| 48736 | + core.debug(`Was not able to coerce ${v} with semver`) | |
| 48737 | + ret = v | |
| 48738 | + } | |
| 48739 | + | |
| 48740 | + return ret | |
| 48741 | +} | |
| 48742 | + | |
| 48743 | +function sortVersions(left, right) { | |
| 48744 | + let ret = 0 | |
| 48745 | + const newL = verAsComparableStr(left) | |
| 48746 | + const newR = verAsComparableStr(right) | |
| 48747 | + function verAsComparableStr(ver) { | |
| 48748 | + const matchGroups = 6 | |
| 48749 | + const verSpec = xyzAbcVersion('', '') | |
| 48750 | + const matches = ver.match(verSpec).splice(1, matchGroups) | |
| 48751 | + | |
| 48752 | + return matches.reduce((acc, v) => acc + (v || '0').padStart(3, '0'), '') | |
| 48753 | + } | |
| 48754 | + | |
| 48755 | + if (newL < newR) { | |
| 48756 | + ret = -1 | |
| 48757 | + } else if (newL > newR) { | |
| 48758 | + ret = 1 | |
| 48759 | + } | |
| 48760 | + | |
| 48761 | + return ret | |
| 48762 | +} | |
| 48763 | + | |
| 48764 | +function isRC(ver) { | |
| 48765 | + return ver.match(xyzAbcVersion('^', '(?:-rc\\.?\\d+)')) | |
| 48766 | +} | |
| 48767 | + | |
| 48768 | +function isKnownBranch(ver) { | |
| 48769 | + return knownBranches.includes(ver) | |
| 48770 | +} | |
| 48771 | + | |
| 48772 | +function isKnownVerBranch(ver) { | |
| 48773 | + return knownBranches.some((b) => ver.match(b)) | |
| 48774 | +} | |
| 48775 | + | |
| 48776 | +function githubARMRunnerArchs() { | |
| 48777 | + return ['ARM', 'ARM64'] | |
| 48778 | +} | |
| 48779 | + | |
| 48780 | +function githubAMDRunnerArchs() { | |
| 48781 | + return ['X86', 'X64'] | |
| 48782 | +} | |
| 48783 | + | |
| 48784 | +function getRunnerOSArchitecture() { | |
| 48785 | + // These options come from: | |
| 48786 | + // https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | |
| 48787 | + if (githubARMRunnerArchs().includes(process.env.RUNNER_ARCH)) { | |
| 48788 | + return 'arm64' | |
| 48789 | + } | |
| 48790 | + | |
| 48791 | + if (githubAMDRunnerArchs().includes(process.env.RUNNER_ARCH)) { | |
| 48792 | + return 'amd64' | |
| 48793 | + } | |
| 48794 | + | |
| 48795 | + throw new Error( | |
| 48796 | + 'Invalid Github runner architecture, expected one of ' + | |
| 48797 | + `${githubAMDRunnerArchs().concat(githubARMRunnerArchs()).join(', ')} ` + | |
| 48798 | + `but got process.env.RUNNER_ARCH = ${process.env.RUNNER_ARCH}`, | |
| 48799 | + ) | |
| 48800 | +} | |
| 48801 | + | |
| 48802 | +function getRunnerOSVersion() { | |
| 48803 | + // List from https://github.com/actions/runner-images?tab=readme-ov-file#available-images | |
| 48804 | + const ImageOSToContainer = { | |
| 48805 | + ubuntu22: 'ubuntu-22.04', | |
| 48806 | + ubuntu24: 'ubuntu-24.04', | |
| 48807 | + win19: 'windows-2019', | |
| 48808 | + win22: 'windows-2022', | |
| 48809 | + win25: 'windows-2025', | |
| 48810 | + macos13: 'macOS-13', | |
| 48811 | + macos14: 'macOS-14', | |
| 48812 | + macos15: 'macOS-15', | |
| 48813 | + } | |
| 48814 | + const deprecatedImageOSToContainer = { | |
| 48815 | + ubuntu18: 'ubuntu-18.04', | |
| 48816 | + ubuntu20: 'ubuntu-20.04', | |
| 48817 | + } | |
| 48818 | + const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS] | |
| 48819 | + if (!containerFromEnvImageOS) { | |
| 48820 | + const deprecatedContainerFromEnvImageOS = | |
| 48821 | + deprecatedImageOSToContainer[process.env.ImageOS] | |
| 48822 | + if (deprecatedContainerFromEnvImageOS) { | |
| 48823 | + core.warning( | |
| 48824 | + `You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` + | |
| 48825 | + 'Support for maintenance is very limited. Consider a non-deprecated version as ' + | |
| 48826 | + 'mentioned in the README.md.', | |
| 48827 | + ) | |
| 48828 | + | |
| 48829 | + return deprecatedContainerFromEnvImageOS | |
| 48830 | + } else { | |
| 48831 | + throw new Error( | |
| 48832 | + "Tried to map a target OS from env. variable 'ImageOS' (got " + | |
| 48833 | + `${process.env.ImageOS}` + | |
| 48834 | + "), but failed. If you're using a " + | |
| 48835 | + "self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " + | |
| 48836 | + "['" + | |
| 48837 | + `${Object.keys(ImageOSToContainer).join("', '")}` + | |
| 48838 | + "']", | |
| 48839 | + ) | |
| 48840 | + } | |
| 48841 | + } | |
| 48842 | + | |
| 48843 | + return containerFromEnvImageOS | |
| 48844 | +} | |
| 48845 | + | |
| 48846 | +async function getUrlResponse(url, headers, attempt = 1) { | |
| 48847 | + try { | |
| 48848 | + const response = await fetch(url, { | |
| 48849 | + headers, | |
| 48850 | + signal: AbortSignal.timeout(10000), | |
| 48851 | + }) | |
| 48852 | + const contentType = response.headers.get('content-type') || '' | |
| 48853 | + | |
| 48854 | + if (!response.ok) { | |
| 48855 | + throw new Error(response.statusText) | |
| 48856 | + } | |
| 48857 | + | |
| 48858 | + if (contentType.indexOf('application/json') !== -1) { | |
| 48859 | + return response.json() | |
| 48860 | + } else { | |
| 48861 | + return response.text() | |
| 48862 | + } | |
| 48863 | + } catch (err) { | |
| 48864 | + core.debug(`Error fetching from ${url}: ${err}`) | |
| 48865 | + | |
| 48866 | + if (attempt <= MAX_HTTP_RETRIES) { | |
| 48867 | + const delay = attempt * 2 * 1000 | |
| 48868 | + core.debug(`Error during fetch. Retrying in ${delay}ms`) | |
| 48869 | + await new Promise((resolve) => setTimeout(resolve, delay)) | |
| 48870 | + return getUrlResponse(url, headers, attempt + 1) | |
| 48871 | + } else { | |
| 48872 | + throw err | |
| 48873 | + } | |
| 48874 | + } | |
| 48875 | +} | |
| 48876 | + | |
| 48877 | +async function get(url0, pageIdxs) { | |
| 48878 | + const url = new URL(url0) | |
| 48879 | + const headers = {} | |
| 48880 | + const GithubToken = getInput('github-token', false) | |
| 48881 | + if (GithubToken && url.host === 'api.github.com') { | |
| 48882 | + headers.authorization = `Bearer ${GithubToken}` | |
| 48883 | + } | |
| 48884 | + | |
| 48885 | + if ((pageIdxs || []).length === 0) { | |
| 48886 | + return getUrlResponse(url, headers) | |
| 48887 | + } else { | |
| 48888 | + return Promise.all( | |
| 48889 | + pageIdxs.map((page) => { | |
| 48890 | + const urlWithPage = new URL(url) | |
| 48891 | + urlWithPage.searchParams.append('page', page) | |
| 48892 | + return getUrlResponse(urlWithPage, headers) | |
| 48893 | + }), | |
| 48894 | + ) | |
| 48895 | + } | |
| 48896 | +} | |
| 48897 | + | |
| 48898 | +function maybePrependWithV(v) { | |
| 48899 | + if (isVersion(v)) { | |
| 48900 | + return `v${v.replace('v', '')}` | |
| 48901 | + } | |
| 48902 | + | |
| 48903 | + return v | |
| 48904 | +} | |
| 48905 | + | |
| 48906 | +function maybeRemoveVPrefix(ver) { | |
| 48907 | + let ret = ver | |
| 48908 | + if (isVersion(ver)) { | |
| 48909 | + ret = ver.replace('v', '') | |
| 48910 | + } | |
| 48911 | + | |
| 48912 | + return ret | |
| 48913 | +} | |
| 48914 | + | |
| 48915 | +function xyzAbcVersion(pref, suf) { | |
| 48916 | + // This accounts for stuff like 6.0.2.0.1.0, as proposed by Erlang's | |
| 48917 | + // https://www.erlang.org/doc/system_principles/versions.html | |
| 48918 | + const dd = '\\.?(\\d+)?' | |
| 48919 | + return new RegExp( | |
| 48920 | + `${pref}(?:OTP-)?v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`, | |
| 48921 | + ) | |
| 48922 | +} | |
| 48923 | + | |
| 48924 | +function versionAbc(ver) { | |
| 48925 | + // For a version like 6.0.2.0.1.0, return 0.1.0 | |
| 48926 | + return ver.match(/\d+(?:\.[^.]+)?(?:\.[^.]+)?(?:\.)?(.*)/)[1] | |
| 48927 | +} | |
| 48928 | + | |
| 48929 | +function isVersion(v) { | |
| 48930 | + return v.match(xyzAbcVersion('^', '$')) !== null | |
| 48931 | +} | |
| 48932 | + | |
| 48933 | +function getInput(inputName, required, alternativeName, alternatives) { | |
| 48934 | + const alternativeValue = (alternatives || new Map()).get(alternativeName) | |
| 48935 | + let input = core.getInput(inputName, { | |
| 48936 | + required: alternativeValue ? false : required, | |
| 48937 | + }) | |
| 48938 | + // We can't have both input and alternativeValue set | |
| 48939 | + if (input && alternativeValue) { | |
| 48940 | + throw new Error( | |
| 48941 | + `Found input ${inputName}=${input} (from the YML) \ | |
| 48942 | +alongside ${alternativeName}=${alternativeValue} \ | |
| 48943 | +(from the version file). You must choose one or the other.`, | |
| 48944 | + ) | |
| 48945 | + } else if (!input) { | |
| 48946 | + input = alternativeValue | |
| 48947 | + } | |
| 48948 | + | |
| 48949 | + return input | |
| 48950 | +} | |
| 48951 | + | |
| 48952 | +function parseVersionFile(versionFilePath0) { | |
| 48953 | + const versionFilePath = path.resolve( | |
| 48954 | + process.env.GITHUB_WORKSPACE, | |
| 48955 | + versionFilePath0, | |
| 48956 | + ) | |
| 48957 | + if (!fs.existsSync(versionFilePath)) { | |
| 48958 | + throw new Error( | |
| 48959 | + `The specified version file, ${versionFilePath0}, does not exist`, | |
| 48960 | + ) | |
| 48961 | + } | |
| 48962 | + | |
| 48963 | + core.startGroup(`Parsing version file at ${versionFilePath0}`) | |
| 48964 | + const appVersions = new Map() | |
| 48965 | + const versions = fs.readFileSync(versionFilePath, 'utf8') | |
| 48966 | + // For the time being we parse .tool-versions | |
| 48967 | + // If we ever start parsing something else, this should | |
| 48968 | + // become default in a new option named e.g. version-file-type | |
| 48969 | + versions.split(/\r?\n/).forEach((line) => { | |
| 48970 | + const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/) | |
| 48971 | + if (appVersion) { | |
| 48972 | + const app = appVersion[1] | |
| 48973 | + if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) { | |
| 48974 | + const [, , , version] = appVersion | |
| 48975 | + core.info(`Consuming ${app} at version ${version}`) | |
| 48976 | + appVersions.set(app, version) | |
| 48977 | + } | |
| 48978 | + } | |
| 48979 | + }) | |
| 48980 | + if (!appVersions.size) { | |
| 48981 | + core.info('There was apparently nothing to consume') | |
| 48982 | + } else { | |
| 48983 | + core.info('... done!') | |
| 48984 | + } | |
| 48985 | + core.endGroup() | |
| 48986 | + | |
| 48987 | + return appVersions | |
| 48988 | +} | |
| 48989 | + | |
| 48990 | +function debugLog(groupName, message) { | |
| 48991 | + const group = `Debugging for ${groupName}` | |
| 48992 | + core.debug( | |
| 48993 | + '┌──────────────────────────────────────────────────────────────────────────', | |
| 48994 | + ) | |
| 48995 | + core.debug(`│ ${group} - start`) | |
| 48996 | + core.debug(message) | |
| 48997 | + core.debug(`│ ${group} - stop`) | |
| 48998 | + core.debug( | |
| 48999 | + '└──────────────────────────────────────────────────────────────────────────', | |
| 49000 | + ) | |
| 49001 | +} | |
| 49002 | + | |
| 49003 | +function hexMirrorsInput() { | |
| 49004 | + return core.getMultilineInput('hexpm-mirrors', { | |
| 49005 | + required: false, | |
| 49006 | + }) | |
| 49007 | +} | |
| 49008 | + | |
| 49009 | +async function doWithMirrors(opts) { | |
| 49010 | + const { hexMirrors, actionTitle, action } = opts | |
| 49011 | + let actionRes | |
| 49012 | + | |
| 49013 | + if (hexMirrors.length === 0) { | |
| 49014 | + throw new Error(`Could not ${actionTitle} from any hex.pm mirror`) | |
| 49015 | + } | |
| 49016 | + | |
| 49017 | + const [hexMirror, ...hexMirrorsT] = hexMirrors | |
| 49018 | + try { | |
| 49019 | + actionRes = await action(hexMirror) | |
| 49020 | + } catch (err) { | |
| 49021 | + core.info( | |
| 49022 | + `Action ${actionTitle} failed for mirror ${hexMirror}, with ${err}`, | |
| 49023 | + ) | |
| 49024 | + core.debug(`Stacktrace: ${err.stack}`) | |
| 49025 | + actionRes = await doWithMirrors({ | |
| 49026 | + hexMirrors: hexMirrorsT, | |
| 49027 | + actionTitle, | |
| 49028 | + action, | |
| 49029 | + }) | |
| 49030 | + } | |
| 49031 | + | |
| 49032 | + return actionRes | |
| 49033 | +} | |
| 49034 | + | |
| 49035 | +async function install(toolName, opts) { | |
| 49036 | + const { osVersion, toolVersion, hexMirror } = opts | |
| 49037 | + const versionSpec = | |
| 49038 | + osVersion !== undefined ? `${osVersion}/${toolVersion}` : toolVersion | |
| 49039 | + let installOpts | |
| 49040 | + | |
| 49041 | + // The installOpts object is composed of supported processPlatform keys | |
| 49042 | + // (e.g. 'linux', 'win32', or 'all' - in case there's no distinction between platforms) | |
| 49043 | + // In each of these keys there's an object with keys: | |
| 49044 | + // * downloadToolURL | |
| 49045 | + // - where to fetch the downloadable from | |
| 49046 | + // * extract | |
| 49047 | + // - if the downloadable is compressed: how to extract it | |
| 49048 | + // - return ['dir', targetDir] | |
| 49049 | + // - if the downloadable is not compressed: a filename.ext you want to cache it under | |
| 49050 | + // - return ['file', filenameWithExt] | |
| 49051 | + // * postExtract | |
| 49052 | + // - stuff to execute outside the cache scope (just after it's created) | |
| 49053 | + // * reportVersion | |
| 49054 | + /// - configuration elements on how to output the tool version, post-install | |
| 49055 | + | |
| 49056 | + switch (toolName) { | |
| 49057 | + case 'otp': | |
| 49058 | + installOpts = { | |
| 49059 | + tool: 'Erlang/OTP', | |
| 49060 | + linux: { | |
| 49061 | + downloadToolURL: () => | |
| 49062 | + `${hexMirror}/builds/otp/${getRunnerOSArchitecture()}/${versionSpec}.tar.gz`, | |
| 49063 | + extract: async (file) => { | |
| 49064 | + const dest = undefined | |
| 49065 | + const flags = ['zx', '--strip-components=1'] | |
| 49066 | + const targetDir = await tc.extractTar(file, dest, flags) | |
| 49067 | + | |
| 49068 | + return ['dir', targetDir] | |
| 49069 | + }, | |
| 49070 | + postExtract: async (cachePath) => { | |
| 49071 | + const cmd = path.join(cachePath, 'Install') | |
| 49072 | + const args = ['-minimal', cachePath] | |
| 49073 | + await exec(cmd, args) | |
| 49074 | + }, | |
| 49075 | + reportVersion: () => { | |
| 49076 | + const cmd = 'erl' | |
| 49077 | + const args = ['-version'] | |
| 49078 | + const env = {} | |
| 49079 | + | |
| 49080 | + return [cmd, args, env] | |
| 49081 | + }, | |
| 49082 | + }, | |
| 49083 | + win32: { | |
| 49084 | + downloadToolURL: () => { | |
| 49085 | + const otpArch = otpArchitecture() | |
| 49086 | + return ( | |
| 49087 | + 'https://github.com/erlang/otp/releases/download/' + | |
| 49088 | + `OTP-${toolVersion}/otp_win${_.escapeRegExp(otpArch)}_${toolVersion}.exe` | |
| 49089 | + ) | |
| 49090 | + }, | |
| 49091 | + extract: async () => ['file', 'otp.exe'], | |
| 49092 | + postExtract: async (cachePath) => { | |
| 49093 | + const cmd = path.join(cachePath, 'otp.exe') | |
| 49094 | + const args = ['/S', `/D=${cachePath}`] | |
| 49095 | + await exec(cmd, args) | |
| 49096 | + }, | |
| 49097 | + reportVersion: () => { | |
| 49098 | + const cmd = 'erl.exe' | |
| 49099 | + const args = ['+V'] | |
| 49100 | + const env = {} | |
| 49101 | + | |
| 49102 | + return [cmd, args, env] | |
| 49103 | + }, | |
| 49104 | + }, | |
| 49105 | + darwin: { | |
| 49106 | + downloadToolURL: (versionSpec) => { | |
| 49107 | + let suffix = '' | |
| 49108 | + if (isKnownVerBranch(versionSpec)) { | |
| 49109 | + // for these otp_builds adds `-latest` in the folder path | |
| 49110 | + suffix = '-latest' | |
| 49111 | + } | |
| 49112 | + return ( | |
| 49113 | + `https://github.com/erlef/otp_builds/releases/download/` + | |
| 49114 | + `${toolVersion}${suffix}/${toolVersion}-macos-${getRunnerOSArchitecture()}.tar.gz` | |
| 49115 | + ) | |
| 49116 | + }, | |
| 49117 | + extract: async (file) => { | |
| 49118 | + const dest = undefined | |
| 49119 | + const flags = ['zx'] | |
| 49120 | + const targetDir = await tc.extractTar(file, dest, flags) | |
| 49121 | + | |
| 49122 | + return ['dir', targetDir] | |
| 49123 | + }, | |
| 49124 | + postExtract: async (/*cachePath*/) => { | |
| 49125 | + // nothing to do | |
| 49126 | + }, | |
| 49127 | + reportVersion: () => { | |
| 49128 | + const cmd = 'erl' | |
| 49129 | + const args = ['-version'] | |
| 49130 | + const env = {} | |
| 49131 | + | |
| 49132 | + return [cmd, args, env] | |
| 49133 | + }, | |
| 49134 | + }, | |
| 49135 | + } | |
| 49136 | + break | |
| 49137 | + case 'elixir': | |
| 49138 | + installOpts = { | |
| 49139 | + tool: 'Elixir', | |
| 49140 | + all: { | |
| 49141 | + downloadToolURL: () => | |
| 49142 | + `${hexMirror}/builds/elixir/${versionSpec}.zip`, | |
| 49143 | + extract: async (file) => { | |
| 49144 | + const targetDir = await tc.extractZip(file) | |
| 49145 | + | |
| 49146 | + return ['dir', targetDir] | |
| 49147 | + }, | |
| 49148 | + postExtract: async () => { | |
| 49149 | + const escriptsPath = path.join(os.homedir(), '.mix', 'escripts') | |
| 49150 | + fs.mkdirSync(escriptsPath, { recursive: true }) | |
| 49151 | + core.addPath(escriptsPath) | |
| 49152 | + | |
| 49153 | + if (debugLoggingEnabled()) { | |
| 49154 | + core.exportVariable('ELIXIR_CLI_ECHO', 'true') | |
| 49155 | + } | |
| 49156 | + }, | |
| 49157 | + reportVersion: () => { | |
| 49158 | + const cmd = 'elixir' | |
| 49159 | + const args = ['-v'] | |
| 49160 | + const env = {} | |
| 49161 | + | |
| 49162 | + return [cmd, args, env] | |
| 49163 | + }, | |
| 49164 | + }, | |
| 49165 | + } | |
| 49166 | + break | |
| 49167 | + case 'gleam': | |
| 49168 | + installOpts = { | |
| 49169 | + tool: 'Gleam', | |
| 49170 | + linux: { | |
| 49171 | + downloadToolURL: () => { | |
| 49172 | + let gz | |
| 49173 | + if ( | |
| 49174 | + versionSpec === 'nightly' || | |
| 49175 | + semver.gt(versionSpec, 'v0.22.1') | |
| 49176 | + ) { | |
| 49177 | + gz = `gleam-${versionSpec}-x86_64-unknown-linux-musl.tar.gz` | |
| 49178 | + } else { | |
| 49179 | + gz = `gleam-${versionSpec}-linux-amd64.tar.gz` | |
| 49180 | + } | |
| 49181 | + | |
| 49182 | + return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${gz}` | |
| 49183 | + }, | |
| 49184 | + extract: async (file) => { | |
| 49185 | + const dest = undefined | |
| 49186 | + const flags = ['zx'] | |
| 49187 | + const targetDir = await tc.extractTar(file, dest, flags) | |
| 49188 | + | |
| 49189 | + return ['dir', targetDir] | |
| 49190 | + }, | |
| 49191 | + postExtract: async (cachePath) => { | |
| 49192 | + const bindir = path.join(cachePath, 'bin') | |
| 49193 | + const oldPath = path.join(cachePath, 'gleam') | |
| 49194 | + const newPath = path.join(bindir, 'gleam') | |
| 49195 | + fs.mkdirSync(bindir) | |
| 49196 | + fs.renameSync(oldPath, newPath) | |
| 49197 | + }, | |
| 49198 | + reportVersion: () => { | |
| 49199 | + const cmd = 'gleam' | |
| 49200 | + const args = ['--version'] | |
| 49201 | + const env = {} | |
| 49202 | + | |
| 49203 | + return [cmd, args, env] | |
| 49204 | + }, | |
| 49205 | + }, | |
| 49206 | + win32: { | |
| 49207 | + downloadToolURL: () => { | |
| 49208 | + let zip | |
| 49209 | + if ( | |
| 49210 | + versionSpec === 'nightly' || | |
| 49211 | + semver.gt(versionSpec, 'v0.22.1') | |
| 49212 | + ) { | |
| 49213 | + zip = `gleam-${versionSpec}-x86_64-pc-windows-msvc.zip` | |
| 49214 | + } else { | |
| 49215 | + zip = `gleam-${versionSpec}-windows-64bit.zip` | |
| 49216 | + } | |
| 49217 | + | |
| 49218 | + return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${zip}` | |
| 49219 | + }, | |
| 49220 | + extract: async (file) => { | |
| 49221 | + const targetDir = await tc.extractZip(file) | |
| 26911 | 49222 | |
| 26912 | 49223 | return ['dir', targetDir] |
| 26913 | 49224 | }, |
| 26914 | − postExtract: async () => { | |
| 26915 | − const escriptsPath = path.join(os.homedir(), '.mix', 'escripts') | |
| 26916 | − fs.mkdirSync(escriptsPath, { recursive: true }) | |
| 26917 | − core.addPath(escriptsPath) | |
| 49225 | + postExtract: async (cachePath) => { | |
| 49226 | + const bindir = path.join(cachePath, 'bin') | |
| 49227 | + const oldPath = path.join(cachePath, 'gleam.exe') | |
| 49228 | + const newPath = path.join(bindir, 'gleam.exe') | |
| 49229 | + fs.mkdirSync(bindir) | |
| 49230 | + fs.renameSync(oldPath, newPath) | |
| 49231 | + }, | |
| 49232 | + reportVersion: () => { | |
| 49233 | + const cmd = 'gleam.exe' | |
| 49234 | + const args = ['--version'] | |
| 49235 | + const env = {} | |
| 49236 | + | |
| 49237 | + return [cmd, args, env] | |
| 49238 | + }, | |
| 49239 | + }, | |
| 49240 | + } | |
| 49241 | + installOpts.darwin = installOpts.linux | |
| 49242 | + break | |
| 49243 | + case 'rebar3': | |
| 49244 | + installOpts = { | |
| 49245 | + tool: 'Rebar3', | |
| 49246 | + linux: { | |
| 49247 | + downloadToolURL: () => { | |
| 49248 | + let url | |
| 49249 | + if (versionSpec === 'nightly') { | |
| 49250 | + url = 'https://s3.amazonaws.com/rebar3-nightly/rebar3' | |
| 49251 | + } else { | |
| 49252 | + url = `https://github.com/erlang/rebar3/releases/download/${versionSpec}/rebar3` | |
| 49253 | + } | |
| 49254 | + | |
| 49255 | + return url | |
| 49256 | + }, | |
| 49257 | + extract: async () => ['file', 'rebar3'], | |
| 49258 | + postExtract: async (cachePath) => { | |
| 49259 | + const bindir = path.join(cachePath, 'bin') | |
| 49260 | + const oldPath = path.join(cachePath, 'rebar3') | |
| 49261 | + const newPath = path.join(bindir, 'rebar3') | |
| 49262 | + fs.mkdirSync(bindir, { recursive: true }) | |
| 49263 | + fs.renameSync(oldPath, newPath) | |
| 49264 | + fs.chmodSync(newPath, 0o755) | |
| 49265 | + }, | |
| 49266 | + reportVersion: () => { | |
| 49267 | + const cmd = 'rebar3' | |
| 49268 | + const args = ['version'] | |
| 49269 | + const env = { | |
| 49270 | + REBAR_GLOBAL_CONFIG_DIR: '/fake-dir', | |
| 49271 | + REBAR_CONFIG: 'fake.config', | |
| 49272 | + } | |
| 49273 | + | |
| 49274 | + return [cmd, args, env] | |
| 49275 | + }, | |
| 49276 | + }, | |
| 49277 | + win32: { | |
| 49278 | + downloadToolURL: () => { | |
| 49279 | + let url | |
| 49280 | + if (versionSpec === 'nightly') { | |
| 49281 | + url = 'https://s3.amazonaws.com/rebar3-nightly/rebar3' | |
| 49282 | + } else { | |
| 49283 | + url = `https://github.com/erlang/rebar3/releases/download/${versionSpec}/rebar3` | |
| 49284 | + } | |
| 49285 | + | |
| 49286 | + return url | |
| 49287 | + }, | |
| 49288 | + extract: async () => ['file', 'rebar3'], | |
| 49289 | + postExtract: async (cachePath) => { | |
| 49290 | + const bindir = path.join(cachePath, 'bin') | |
| 49291 | + const oldPath = path.join(cachePath, 'rebar3') | |
| 49292 | + const newPath = path.join(bindir, 'rebar3') | |
| 49293 | + fs.mkdirSync(bindir) | |
| 49294 | + fs.renameSync(oldPath, newPath) | |
| 49295 | + fs.chmodSync(newPath, 0o755) | |
| 49296 | + | |
| 49297 | + const ps1Filename = path.join(bindir, 'rebar3.ps1') | |
| 49298 | + fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) | |
| 49299 | + | |
| 49300 | + const cmdFilename = path.join(bindir, 'rebar3.cmd') | |
| 49301 | + fs.writeFileSync( | |
| 49302 | + cmdFilename, | |
| 49303 | + `@echo off\r\nescript.exe ${newPath} %*`, | |
| 49304 | + ) | |
| 49305 | + }, | |
| 49306 | + reportVersion: () => { | |
| 49307 | + const cmd = 'rebar3.cmd' | |
| 49308 | + const args = ['version'] | |
| 49309 | + const env = {} | |
| 49310 | + | |
| 49311 | + return [cmd, args, env] | |
| 49312 | + }, | |
| 49313 | + }, | |
| 49314 | + } | |
| 49315 | + installOpts.darwin = installOpts.linux | |
| 49316 | + break | |
| 49317 | + default: | |
| 49318 | + throw new Error(`no installer for ${toolName}`) | |
| 49319 | + } | |
| 49320 | + | |
| 49321 | + await installTool({ toolName, versionSpec, installOpts }) | |
| 49322 | +} | |
| 49323 | + | |
| 49324 | +async function installTool(opts) { | |
| 49325 | + const { toolName, versionSpec, installOpts } = opts | |
| 49326 | + const platformOpts = installOpts[process.platform] || installOpts.all | |
| 49327 | + let cachePath = tc.find(toolName, versionSpec) | |
| 49328 | + | |
| 49329 | + core.debug(`Checking if ${installOpts.tool} is already cached...`) | |
| 49330 | + if (cachePath === '') { | |
| 49331 | + core.debug(" ... it isn't!") | |
| 49332 | + const downloadToolURL = platformOpts.downloadToolURL(versionSpec) | |
| 49333 | + const file = await tc.downloadTool(downloadToolURL) | |
| 49334 | + const [targetElemType, targetElem] = await platformOpts.extract(file) | |
| 49335 | + | |
| 49336 | + if (targetElemType === 'dir') { | |
| 49337 | + cachePath = await tc.cacheDir(targetElem, toolName, versionSpec) | |
| 49338 | + } else if (targetElemType === 'file') { | |
| 49339 | + cachePath = await tc.cacheFile(file, targetElem, toolName, versionSpec) | |
| 49340 | + } | |
| 49341 | + } else { | |
| 49342 | + core.debug(` ... it is, at ${cachePath}`) | |
| 49343 | + } | |
| 49344 | + | |
| 49345 | + // This makes sure we run, e.g. in Windows, the installer in the runner | |
| 49346 | + // We're not caching the install, just the downloaded tool | |
| 49347 | + const runnerToolPath = path.join( | |
| 49348 | + process.env.RUNNER_TEMP, | |
| 49349 | + '.setup-beam', | |
| 49350 | + toolName, | |
| 49351 | + ) | |
| 49352 | + fs.cpSync(cachePath, runnerToolPath, { recursive: true }) | |
| 49353 | + | |
| 49354 | + core.debug('Performing post extract operations...') | |
| 49355 | + await platformOpts.postExtract(runnerToolPath) | |
| 49356 | + | |
| 49357 | + core.debug(`Adding ${runnerToolPath}' bin to system path`) | |
| 49358 | + const runnerToolPathBin = path.join(runnerToolPath, 'bin') | |
| 49359 | + core.addPath(runnerToolPathBin) | |
| 49360 | + | |
| 49361 | + const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() | |
| 49362 | + core.debug(`Exporting ${installDirForVarName} as ${runnerToolPath}`) | |
| 49363 | + core.exportVariable(installDirForVarName, runnerToolPath) | |
| 49364 | + | |
| 49365 | + core.info(`Installed ${installOpts.tool} version`) | |
| 49366 | + const [cmd, args, env] = platformOpts.reportVersion() | |
| 49367 | + await exec(cmd, args, { env: { ...process.env, ...env } }) | |
| 49368 | +} | |
| 49369 | + | |
| 49370 | +function checkOtpArchitecture() { | |
| 49371 | + const otpArch = otpArchitecture() | |
| 49372 | + | |
| 49373 | + if (process.platform !== 'win32' && otpArch == '32') { | |
| 49374 | + throw new Error( | |
| 49375 | + '@erlef/setup-beam only supports otp-architecture=32 on Windows', | |
| 49376 | + ) | |
| 49377 | + } | |
| 49378 | + | |
| 49379 | + if (!['32', '64'].includes(otpArch)) { | |
| 49380 | + throw new Error('otp-architecture must be 32 or 64') | |
| 49381 | + } | |
| 49382 | +} | |
| 49383 | + | |
| 49384 | +function debugLoggingEnabled() { | |
| 49385 | + return !!process.env.RUNNER_DEBUG | |
| 49386 | +} | |
| 49387 | + | |
| 49388 | +module.exports = { | |
| 49389 | + get, | |
| 49390 | + getElixirVersion, | |
| 49391 | + getGleamVersion, | |
| 49392 | + getOTPVersion, | |
| 49393 | + getRebar3Version, | |
| 49394 | + getVersionFromSpec, | |
| 49395 | + githubAMDRunnerArchs, | |
| 49396 | + githubARMRunnerArchs, | |
| 49397 | + install, | |
| 49398 | + installOTP, | |
| 49399 | + maybeInstallElixir, | |
| 49400 | + maybeInstallGleam, | |
| 49401 | + maybeInstallRebar3, | |
| 49402 | + parseVersionFile, | |
| 49403 | +} | |
| 49404 | + | |
| 49405 | + | |
| 49406 | +/***/ }), | |
| 49407 | + | |
| 49408 | +/***/ 2613: | |
| 49409 | +/***/ ((module) => { | |
| 49410 | + | |
| 49411 | +"use strict"; | |
| 49412 | +module.exports = require("assert"); | |
| 49413 | + | |
| 49414 | +/***/ }), | |
| 49415 | + | |
| 49416 | +/***/ 290: | |
| 49417 | +/***/ ((module) => { | |
| 49418 | + | |
| 49419 | +"use strict"; | |
| 49420 | +module.exports = require("async_hooks"); | |
| 49421 | + | |
| 49422 | +/***/ }), | |
| 49423 | + | |
| 49424 | +/***/ 181: | |
| 49425 | +/***/ ((module) => { | |
| 49426 | + | |
| 49427 | +"use strict"; | |
| 49428 | +module.exports = require("buffer"); | |
| 49429 | + | |
| 49430 | +/***/ }), | |
| 49431 | + | |
| 49432 | +/***/ 5317: | |
| 49433 | +/***/ ((module) => { | |
| 49434 | + | |
| 49435 | +"use strict"; | |
| 49436 | +module.exports = require("child_process"); | |
| 49437 | + | |
| 49438 | +/***/ }), | |
| 49439 | + | |
| 49440 | +/***/ 4236: | |
| 49441 | +/***/ ((module) => { | |
| 49442 | + | |
| 49443 | +"use strict"; | |
| 49444 | +module.exports = require("console"); | |
| 49445 | + | |
| 49446 | +/***/ }), | |
| 49447 | + | |
| 49448 | +/***/ 6982: | |
| 49449 | +/***/ ((module) => { | |
| 49450 | + | |
| 49451 | +"use strict"; | |
| 49452 | +module.exports = require("crypto"); | |
| 49453 | + | |
| 49454 | +/***/ }), | |
| 49455 | + | |
| 49456 | +/***/ 1637: | |
| 49457 | +/***/ ((module) => { | |
| 49458 | + | |
| 49459 | +"use strict"; | |
| 49460 | +module.exports = require("diagnostics_channel"); | |
| 49461 | + | |
| 49462 | +/***/ }), | |
| 49463 | + | |
| 49464 | +/***/ 4434: | |
| 49465 | +/***/ ((module) => { | |
| 49466 | + | |
| 49467 | +"use strict"; | |
| 49468 | +module.exports = require("events"); | |
| 49469 | + | |
| 49470 | +/***/ }), | |
| 49471 | + | |
| 49472 | +/***/ 9896: | |
| 49473 | +/***/ ((module) => { | |
| 49474 | + | |
| 49475 | +"use strict"; | |
| 49476 | +module.exports = require("fs"); | |
| 49477 | + | |
| 49478 | +/***/ }), | |
| 49479 | + | |
| 49480 | +/***/ 8611: | |
| 49481 | +/***/ ((module) => { | |
| 49482 | + | |
| 49483 | +"use strict"; | |
| 49484 | +module.exports = require("http"); | |
| 49485 | + | |
| 49486 | +/***/ }), | |
| 49487 | + | |
| 49488 | +/***/ 5675: | |
| 49489 | +/***/ ((module) => { | |
| 49490 | + | |
| 49491 | +"use strict"; | |
| 49492 | +module.exports = require("http2"); | |
| 49493 | + | |
| 49494 | +/***/ }), | |
| 49495 | + | |
| 49496 | +/***/ 5692: | |
| 49497 | +/***/ ((module) => { | |
| 49498 | + | |
| 49499 | +"use strict"; | |
| 49500 | +module.exports = require("https"); | |
| 49501 | + | |
| 49502 | +/***/ }), | |
| 49503 | + | |
| 49504 | +/***/ 9278: | |
| 49505 | +/***/ ((module) => { | |
| 49506 | + | |
| 49507 | +"use strict"; | |
| 49508 | +module.exports = require("net"); | |
| 49509 | + | |
| 49510 | +/***/ }), | |
| 49511 | + | |
| 49512 | +/***/ 7598: | |
| 49513 | +/***/ ((module) => { | |
| 49514 | + | |
| 49515 | +"use strict"; | |
| 49516 | +module.exports = require("node:crypto"); | |
| 49517 | + | |
| 49518 | +/***/ }), | |
| 49519 | + | |
| 49520 | +/***/ 8474: | |
| 49521 | +/***/ ((module) => { | |
| 49522 | + | |
| 49523 | +"use strict"; | |
| 49524 | +module.exports = require("node:events"); | |
| 49525 | + | |
| 49526 | +/***/ }), | |
| 49527 | + | |
| 49528 | +/***/ 7075: | |
| 49529 | +/***/ ((module) => { | |
| 49530 | + | |
| 49531 | +"use strict"; | |
| 49532 | +module.exports = require("node:stream"); | |
| 49533 | + | |
| 49534 | +/***/ }), | |
| 49535 | + | |
| 49536 | +/***/ 7975: | |
| 49537 | +/***/ ((module) => { | |
| 49538 | + | |
| 49539 | +"use strict"; | |
| 49540 | +module.exports = require("node:util"); | |
| 49541 | + | |
| 49542 | +/***/ }), | |
| 49543 | + | |
| 49544 | +/***/ 857: | |
| 49545 | +/***/ ((module) => { | |
| 49546 | + | |
| 49547 | +"use strict"; | |
| 49548 | +module.exports = require("os"); | |
| 49549 | + | |
| 49550 | +/***/ }), | |
| 49551 | + | |
| 49552 | +/***/ 6928: | |
| 49553 | +/***/ ((module) => { | |
| 49554 | + | |
| 49555 | +"use strict"; | |
| 49556 | +module.exports = require("path"); | |
| 49557 | + | |
| 49558 | +/***/ }), | |
| 49559 | + | |
| 49560 | +/***/ 2987: | |
| 49561 | +/***/ ((module) => { | |
| 49562 | + | |
| 49563 | +"use strict"; | |
| 49564 | +module.exports = require("perf_hooks"); | |
| 49565 | + | |
| 49566 | +/***/ }), | |
| 49567 | + | |
| 49568 | +/***/ 3480: | |
| 49569 | +/***/ ((module) => { | |
| 49570 | + | |
| 49571 | +"use strict"; | |
| 49572 | +module.exports = require("querystring"); | |
| 49573 | + | |
| 49574 | +/***/ }), | |
| 49575 | + | |
| 49576 | +/***/ 2203: | |
| 49577 | +/***/ ((module) => { | |
| 49578 | + | |
| 49579 | +"use strict"; | |
| 49580 | +module.exports = require("stream"); | |
| 49581 | + | |
| 49582 | +/***/ }), | |
| 49583 | + | |
| 49584 | +/***/ 3774: | |
| 49585 | +/***/ ((module) => { | |
| 49586 | + | |
| 49587 | +"use strict"; | |
| 49588 | +module.exports = require("stream/web"); | |
| 49589 | + | |
| 49590 | +/***/ }), | |
| 49591 | + | |
| 49592 | +/***/ 3193: | |
| 49593 | +/***/ ((module) => { | |
| 49594 | + | |
| 49595 | +"use strict"; | |
| 49596 | +module.exports = require("string_decoder"); | |
| 49597 | + | |
| 49598 | +/***/ }), | |
| 49599 | + | |
| 49600 | +/***/ 3557: | |
| 49601 | +/***/ ((module) => { | |
| 49602 | + | |
| 49603 | +"use strict"; | |
| 49604 | +module.exports = require("timers"); | |
| 49605 | + | |
| 49606 | +/***/ }), | |
| 49607 | + | |
| 49608 | +/***/ 4756: | |
| 49609 | +/***/ ((module) => { | |
| 49610 | + | |
| 49611 | +"use strict"; | |
| 49612 | +module.exports = require("tls"); | |
| 49613 | + | |
| 49614 | +/***/ }), | |
| 49615 | + | |
| 49616 | +/***/ 7016: | |
| 49617 | +/***/ ((module) => { | |
| 49618 | + | |
| 49619 | +"use strict"; | |
| 49620 | +module.exports = require("url"); | |
| 49621 | + | |
| 49622 | +/***/ }), | |
| 49623 | + | |
| 49624 | +/***/ 9023: | |
| 49625 | +/***/ ((module) => { | |
| 49626 | + | |
| 49627 | +"use strict"; | |
| 49628 | +module.exports = require("util"); | |
| 49629 | + | |
| 49630 | +/***/ }), | |
| 49631 | + | |
| 49632 | +/***/ 8253: | |
| 49633 | +/***/ ((module) => { | |
| 49634 | + | |
| 49635 | +"use strict"; | |
| 49636 | +module.exports = require("util/types"); | |
| 49637 | + | |
| 49638 | +/***/ }), | |
| 49639 | + | |
| 49640 | +/***/ 8167: | |
| 49641 | +/***/ ((module) => { | |
| 49642 | + | |
| 49643 | +"use strict"; | |
| 49644 | +module.exports = require("worker_threads"); | |
| 49645 | + | |
| 49646 | +/***/ }), | |
| 49647 | + | |
| 49648 | +/***/ 3106: | |
| 49649 | +/***/ ((module) => { | |
| 49650 | + | |
| 49651 | +"use strict"; | |
| 49652 | +module.exports = require("zlib"); | |
| 49653 | + | |
| 49654 | +/***/ }), | |
| 49655 | + | |
| 49656 | +/***/ 7182: | |
| 49657 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 49658 | + | |
| 49659 | +"use strict"; | |
| 49660 | + | |
| 49661 | + | |
| 49662 | +const WritableStream = (__nccwpck_require__(7075).Writable) | |
| 49663 | +const inherits = (__nccwpck_require__(7975).inherits) | |
| 49664 | + | |
| 49665 | +const StreamSearch = __nccwpck_require__(4136) | |
| 49666 | + | |
| 49667 | +const PartStream = __nccwpck_require__(612) | |
| 49668 | +const HeaderParser = __nccwpck_require__(2271) | |
| 49669 | + | |
| 49670 | +const DASH = 45 | |
| 49671 | +const B_ONEDASH = Buffer.from('-') | |
| 49672 | +const B_CRLF = Buffer.from('\r\n') | |
| 49673 | +const EMPTY_FN = function () {} | |
| 49674 | + | |
| 49675 | +function Dicer (cfg) { | |
| 49676 | + if (!(this instanceof Dicer)) { return new Dicer(cfg) } | |
| 49677 | + WritableStream.call(this, cfg) | |
| 49678 | + | |
| 49679 | + if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } | |
| 49680 | + | |
| 49681 | + if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } | |
| 49682 | + | |
| 49683 | + this._headerFirst = cfg.headerFirst | |
| 49684 | + | |
| 49685 | + this._dashes = 0 | |
| 49686 | + this._parts = 0 | |
| 49687 | + this._finished = false | |
| 49688 | + this._realFinish = false | |
| 49689 | + this._isPreamble = true | |
| 49690 | + this._justMatched = false | |
| 49691 | + this._firstWrite = true | |
| 49692 | + this._inHeader = true | |
| 49693 | + this._part = undefined | |
| 49694 | + this._cb = undefined | |
| 49695 | + this._ignoreData = false | |
| 49696 | + this._partOpts = { highWaterMark: cfg.partHwm } | |
| 49697 | + this._pause = false | |
| 49698 | + | |
| 49699 | + const self = this | |
| 49700 | + this._hparser = new HeaderParser(cfg) | |
| 49701 | + this._hparser.on('header', function (header) { | |
| 49702 | + self._inHeader = false | |
| 49703 | + self._part.emit('header', header) | |
| 49704 | + }) | |
| 49705 | +} | |
| 49706 | +inherits(Dicer, WritableStream) | |
| 49707 | + | |
| 49708 | +Dicer.prototype.emit = function (ev) { | |
| 49709 | + if (ev === 'finish' && !this._realFinish) { | |
| 49710 | + if (!this._finished) { | |
| 49711 | + const self = this | |
| 49712 | + process.nextTick(function () { | |
| 49713 | + self.emit('error', new Error('Unexpected end of multipart data')) | |
| 49714 | + if (self._part && !self._ignoreData) { | |
| 49715 | + const type = (self._isPreamble ? 'Preamble' : 'Part') | |
| 49716 | + self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) | |
| 49717 | + self._part.push(null) | |
| 49718 | + process.nextTick(function () { | |
| 49719 | + self._realFinish = true | |
| 49720 | + self.emit('finish') | |
| 49721 | + self._realFinish = false | |
| 49722 | + }) | |
| 49723 | + return | |
| 49724 | + } | |
| 49725 | + self._realFinish = true | |
| 49726 | + self.emit('finish') | |
| 49727 | + self._realFinish = false | |
| 49728 | + }) | |
| 49729 | + } | |
| 49730 | + } else { WritableStream.prototype.emit.apply(this, arguments) } | |
| 49731 | +} | |
| 49732 | + | |
| 49733 | +Dicer.prototype._write = function (data, encoding, cb) { | |
| 49734 | + // ignore unexpected data (e.g. extra trailer data after finished) | |
| 49735 | + if (!this._hparser && !this._bparser) { return cb() } | |
| 49736 | + | |
| 49737 | + if (this._headerFirst && this._isPreamble) { | |
| 49738 | + if (!this._part) { | |
| 49739 | + this._part = new PartStream(this._partOpts) | |
| 49740 | + if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } | |
| 49741 | + } | |
| 49742 | + const r = this._hparser.push(data) | |
| 49743 | + if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } | |
| 49744 | + } | |
| 49745 | + | |
| 49746 | + // allows for "easier" testing | |
| 49747 | + if (this._firstWrite) { | |
| 49748 | + this._bparser.push(B_CRLF) | |
| 49749 | + this._firstWrite = false | |
| 49750 | + } | |
| 49751 | + | |
| 49752 | + this._bparser.push(data) | |
| 49753 | + | |
| 49754 | + if (this._pause) { this._cb = cb } else { cb() } | |
| 49755 | +} | |
| 49756 | + | |
| 49757 | +Dicer.prototype.reset = function () { | |
| 49758 | + this._part = undefined | |
| 49759 | + this._bparser = undefined | |
| 49760 | + this._hparser = undefined | |
| 49761 | +} | |
| 49762 | + | |
| 49763 | +Dicer.prototype.setBoundary = function (boundary) { | |
| 49764 | + const self = this | |
| 49765 | + this._bparser = new StreamSearch('\r\n--' + boundary) | |
| 49766 | + this._bparser.on('info', function (isMatch, data, start, end) { | |
| 49767 | + self._oninfo(isMatch, data, start, end) | |
| 49768 | + }) | |
| 49769 | +} | |
| 49770 | + | |
| 49771 | +Dicer.prototype._ignore = function () { | |
| 49772 | + if (this._part && !this._ignoreData) { | |
| 49773 | + this._ignoreData = true | |
| 49774 | + this._part.on('error', EMPTY_FN) | |
| 49775 | + // we must perform some kind of read on the stream even though we are | |
| 49776 | + // ignoring the data, otherwise node's Readable stream will not emit 'end' | |
| 49777 | + // after pushing null to the stream | |
| 49778 | + this._part.resume() | |
| 49779 | + } | |
| 49780 | +} | |
| 49781 | + | |
| 49782 | +Dicer.prototype._oninfo = function (isMatch, data, start, end) { | |
| 49783 | + let buf; const self = this; let i = 0; let r; let shouldWriteMore = true | |
| 49784 | + | |
| 49785 | + if (!this._part && this._justMatched && data) { | |
| 49786 | + while (this._dashes < 2 && (start + i) < end) { | |
| 49787 | + if (data[start + i] === DASH) { | |
| 49788 | + ++i | |
| 49789 | + ++this._dashes | |
| 49790 | + } else { | |
| 49791 | + if (this._dashes) { buf = B_ONEDASH } | |
| 49792 | + this._dashes = 0 | |
| 49793 | + break | |
| 49794 | + } | |
| 49795 | + } | |
| 49796 | + if (this._dashes === 2) { | |
| 49797 | + if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } | |
| 49798 | + this.reset() | |
| 49799 | + this._finished = true | |
| 49800 | + // no more parts will be added | |
| 49801 | + if (self._parts === 0) { | |
| 49802 | + self._realFinish = true | |
| 49803 | + self.emit('finish') | |
| 49804 | + self._realFinish = false | |
| 49805 | + } | |
| 49806 | + } | |
| 49807 | + if (this._dashes) { return } | |
| 49808 | + } | |
| 49809 | + if (this._justMatched) { this._justMatched = false } | |
| 49810 | + if (!this._part) { | |
| 49811 | + this._part = new PartStream(this._partOpts) | |
| 49812 | + this._part._read = function (n) { | |
| 49813 | + self._unpause() | |
| 49814 | + } | |
| 49815 | + if (this._isPreamble && this.listenerCount('preamble') !== 0) { | |
| 49816 | + this.emit('preamble', this._part) | |
| 49817 | + } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { | |
| 49818 | + this.emit('part', this._part) | |
| 49819 | + } else { | |
| 49820 | + this._ignore() | |
| 49821 | + } | |
| 49822 | + if (!this._isPreamble) { this._inHeader = true } | |
| 49823 | + } | |
| 49824 | + if (data && start < end && !this._ignoreData) { | |
| 49825 | + if (this._isPreamble || !this._inHeader) { | |
| 49826 | + if (buf) { shouldWriteMore = this._part.push(buf) } | |
| 49827 | + shouldWriteMore = this._part.push(data.slice(start, end)) | |
| 49828 | + if (!shouldWriteMore) { this._pause = true } | |
| 49829 | + } else if (!this._isPreamble && this._inHeader) { | |
| 49830 | + if (buf) { this._hparser.push(buf) } | |
| 49831 | + r = this._hparser.push(data.slice(start, end)) | |
| 49832 | + if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } | |
| 49833 | + } | |
| 49834 | + } | |
| 49835 | + if (isMatch) { | |
| 49836 | + this._hparser.reset() | |
| 49837 | + if (this._isPreamble) { this._isPreamble = false } else { | |
| 49838 | + if (start !== end) { | |
| 49839 | + ++this._parts | |
| 49840 | + this._part.on('end', function () { | |
| 49841 | + if (--self._parts === 0) { | |
| 49842 | + if (self._finished) { | |
| 49843 | + self._realFinish = true | |
| 49844 | + self.emit('finish') | |
| 49845 | + self._realFinish = false | |
| 49846 | + } else { | |
| 49847 | + self._unpause() | |
| 49848 | + } | |
| 49849 | + } | |
| 49850 | + }) | |
| 49851 | + } | |
| 49852 | + } | |
| 49853 | + this._part.push(null) | |
| 49854 | + this._part = undefined | |
| 49855 | + this._ignoreData = false | |
| 49856 | + this._justMatched = true | |
| 49857 | + this._dashes = 0 | |
| 49858 | + } | |
| 49859 | +} | |
| 49860 | + | |
| 49861 | +Dicer.prototype._unpause = function () { | |
| 49862 | + if (!this._pause) { return } | |
| 49863 | + | |
| 49864 | + this._pause = false | |
| 49865 | + if (this._cb) { | |
| 49866 | + const cb = this._cb | |
| 49867 | + this._cb = undefined | |
| 49868 | + cb() | |
| 49869 | + } | |
| 49870 | +} | |
| 49871 | + | |
| 49872 | +module.exports = Dicer | |
| 49873 | + | |
| 49874 | + | |
| 49875 | +/***/ }), | |
| 49876 | + | |
| 49877 | +/***/ 2271: | |
| 49878 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 49879 | + | |
| 49880 | +"use strict"; | |
| 49881 | + | |
| 49882 | + | |
| 49883 | +const EventEmitter = (__nccwpck_require__(8474).EventEmitter) | |
| 49884 | +const inherits = (__nccwpck_require__(7975).inherits) | |
| 49885 | +const getLimit = __nccwpck_require__(2393) | |
| 49886 | + | |
| 49887 | +const StreamSearch = __nccwpck_require__(4136) | |
| 49888 | + | |
| 49889 | +const B_DCRLF = Buffer.from('\r\n\r\n') | |
| 49890 | +const RE_CRLF = /\r\n/g | |
| 49891 | +const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex | |
| 49892 | + | |
| 49893 | +function HeaderParser (cfg) { | |
| 49894 | + EventEmitter.call(this) | |
| 49895 | + | |
| 49896 | + cfg = cfg || {} | |
| 49897 | + const self = this | |
| 49898 | + this.nread = 0 | |
| 49899 | + this.maxed = false | |
| 49900 | + this.npairs = 0 | |
| 49901 | + this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) | |
| 49902 | + this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) | |
| 49903 | + this.buffer = '' | |
| 49904 | + this.header = {} | |
| 49905 | + this.finished = false | |
| 49906 | + this.ss = new StreamSearch(B_DCRLF) | |
| 49907 | + this.ss.on('info', function (isMatch, data, start, end) { | |
| 49908 | + if (data && !self.maxed) { | |
| 49909 | + if (self.nread + end - start >= self.maxHeaderSize) { | |
| 49910 | + end = self.maxHeaderSize - self.nread + start | |
| 49911 | + self.nread = self.maxHeaderSize | |
| 49912 | + self.maxed = true | |
| 49913 | + } else { self.nread += (end - start) } | |
| 49914 | + | |
| 49915 | + self.buffer += data.toString('binary', start, end) | |
| 49916 | + } | |
| 49917 | + if (isMatch) { self._finish() } | |
| 49918 | + }) | |
| 49919 | +} | |
| 49920 | +inherits(HeaderParser, EventEmitter) | |
| 49921 | + | |
| 49922 | +HeaderParser.prototype.push = function (data) { | |
| 49923 | + const r = this.ss.push(data) | |
| 49924 | + if (this.finished) { return r } | |
| 49925 | +} | |
| 49926 | + | |
| 49927 | +HeaderParser.prototype.reset = function () { | |
| 49928 | + this.finished = false | |
| 49929 | + this.buffer = '' | |
| 49930 | + this.header = {} | |
| 49931 | + this.ss.reset() | |
| 49932 | +} | |
| 49933 | + | |
| 49934 | +HeaderParser.prototype._finish = function () { | |
| 49935 | + if (this.buffer) { this._parseHeader() } | |
| 49936 | + this.ss.matches = this.ss.maxMatches | |
| 49937 | + const header = this.header | |
| 49938 | + this.header = {} | |
| 49939 | + this.buffer = '' | |
| 49940 | + this.finished = true | |
| 49941 | + this.nread = this.npairs = 0 | |
| 49942 | + this.maxed = false | |
| 49943 | + this.emit('header', header) | |
| 49944 | +} | |
| 49945 | + | |
| 49946 | +HeaderParser.prototype._parseHeader = function () { | |
| 49947 | + if (this.npairs === this.maxHeaderPairs) { return } | |
| 49948 | + | |
| 49949 | + const lines = this.buffer.split(RE_CRLF) | |
| 49950 | + const len = lines.length | |
| 49951 | + let m, h | |
| 49952 | + | |
| 49953 | + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var | |
| 49954 | + if (lines[i].length === 0) { continue } | |
| 49955 | + if (lines[i][0] === '\t' || lines[i][0] === ' ') { | |
| 49956 | + // folded header content | |
| 49957 | + // RFC2822 says to just remove the CRLF and not the whitespace following | |
| 49958 | + // it, so we follow the RFC and include the leading whitespace ... | |
| 49959 | + if (h) { | |
| 49960 | + this.header[h][this.header[h].length - 1] += lines[i] | |
| 49961 | + continue | |
| 49962 | + } | |
| 49963 | + } | |
| 49964 | + | |
| 49965 | + const posColon = lines[i].indexOf(':') | |
| 49966 | + if ( | |
| 49967 | + posColon === -1 || | |
| 49968 | + posColon === 0 | |
| 49969 | + ) { | |
| 49970 | + return | |
| 49971 | + } | |
| 49972 | + m = RE_HDR.exec(lines[i]) | |
| 49973 | + h = m[1].toLowerCase() | |
| 49974 | + this.header[h] = this.header[h] || [] | |
| 49975 | + this.header[h].push((m[2] || '')) | |
| 49976 | + if (++this.npairs === this.maxHeaderPairs) { break } | |
| 49977 | + } | |
| 49978 | +} | |
| 49979 | + | |
| 49980 | +module.exports = HeaderParser | |
| 49981 | + | |
| 49982 | + | |
| 49983 | +/***/ }), | |
| 49984 | + | |
| 49985 | +/***/ 612: | |
| 49986 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 49987 | + | |
| 49988 | +"use strict"; | |
| 49989 | + | |
| 49990 | + | |
| 49991 | +const inherits = (__nccwpck_require__(7975).inherits) | |
| 49992 | +const ReadableStream = (__nccwpck_require__(7075).Readable) | |
| 49993 | + | |
| 49994 | +function PartStream (opts) { | |
| 49995 | + ReadableStream.call(this, opts) | |
| 49996 | +} | |
| 49997 | +inherits(PartStream, ReadableStream) | |
| 49998 | + | |
| 49999 | +PartStream.prototype._read = function (n) {} | |
| 50000 | + | |
| 50001 | +module.exports = PartStream | |
| 50002 | + | |
| 50003 | + | |
| 50004 | +/***/ }), | |
| 50005 | + | |
| 50006 | +/***/ 4136: | |
| 50007 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 26918 | 50008 | |
| 26919 | − if (debugLoggingEnabled()) { | |
| 26920 | − core.exportVariable('ELIXIR_CLI_ECHO', 'true') | |
| 26921 | − } | |
| 26922 | − }, | |
| 26923 | − reportVersion: () => { | |
| 26924 | − const cmd = 'elixir' | |
| 26925 | − const args = ['-v'] | |
| 26926 | − const env = {} | |
| 50009 | +"use strict"; | |
| 26927 | 50010 | |
| 26928 | − return [cmd, args, env] | |
| 26929 | − }, | |
| 26930 | − }, | |
| 26931 | − } | |
| 26932 | − break | |
| 26933 | − case 'gleam': | |
| 26934 | − installOpts = { | |
| 26935 | − tool: 'Gleam', | |
| 26936 | − linux: { | |
| 26937 | − downloadToolURL: () => { | |
| 26938 | − let gz | |
| 26939 | − if ( | |
| 26940 | − versionSpec === 'nightly' || | |
| 26941 | − semver.gt(versionSpec, 'v0.22.1') | |
| 26942 | − ) { | |
| 26943 | − gz = `gleam-${versionSpec}-x86_64-unknown-linux-musl.tar.gz` | |
| 26944 | − } else { | |
| 26945 | − gz = `gleam-${versionSpec}-linux-amd64.tar.gz` | |
| 26946 | − } | |
| 26947 | 50011 | |
| 26948 | − return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${gz}` | |
| 26949 | − }, | |
| 26950 | − extract: async (file) => { | |
| 26951 | − const dest = undefined | |
| 26952 | − const flags = ['zx'] | |
| 26953 | − const targetDir = await tc.extractTar(file, dest, flags) | |
| 50012 | +/** | |
| 50013 | + * Copyright Brian White. All rights reserved. | |
| 50014 | + * | |
| 50015 | + * @see https://github.com/mscdex/streamsearch | |
| 50016 | + * | |
| 50017 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 50018 | + * of this software and associated documentation files (the "Software"), to | |
| 50019 | + * deal in the Software without restriction, including without limitation the | |
| 50020 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
| 50021 | + * sell copies of the Software, and to permit persons to whom the Software is | |
| 50022 | + * furnished to do so, subject to the following conditions: | |
| 50023 | + * | |
| 50024 | + * The above copyright notice and this permission notice shall be included in | |
| 50025 | + * all copies or substantial portions of the Software. | |
| 50026 | + * | |
| 50027 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 50028 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 50029 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 50030 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 50031 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| 50032 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
| 50033 | + * IN THE SOFTWARE. | |
| 50034 | + * | |
| 50035 | + * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation | |
| 50036 | + * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool | |
| 50037 | + */ | |
| 50038 | +const EventEmitter = (__nccwpck_require__(8474).EventEmitter) | |
| 50039 | +const inherits = (__nccwpck_require__(7975).inherits) | |
| 26954 | 50040 | |
| 26955 | − return ['dir', targetDir] | |
| 26956 | − }, | |
| 26957 | − postExtract: async (cachePath) => { | |
| 26958 | − const bindir = path.join(cachePath, 'bin') | |
| 26959 | − const oldPath = path.join(cachePath, 'gleam') | |
| 26960 | − const newPath = path.join(bindir, 'gleam') | |
| 26961 | − fs.mkdirSync(bindir) | |
| 26962 | − fs.renameSync(oldPath, newPath) | |
| 26963 | − }, | |
| 26964 | − reportVersion: () => { | |
| 26965 | − const cmd = 'gleam' | |
| 26966 | − const args = ['--version'] | |
| 26967 | − const env = {} | |
| 50041 | +function SBMH (needle) { | |
| 50042 | + if (typeof needle === 'string') { | |
| 50043 | + needle = Buffer.from(needle) | |
| 50044 | + } | |
| 26968 | 50045 | |
| 26969 | − return [cmd, args, env] | |
| 26970 | − }, | |
| 26971 | − }, | |
| 26972 | − win32: { | |
| 26973 | − downloadToolURL: () => { | |
| 26974 | − let zip | |
| 26975 | − if ( | |
| 26976 | − versionSpec === 'nightly' || | |
| 26977 | − semver.gt(versionSpec, 'v0.22.1') | |
| 26978 | − ) { | |
| 26979 | − zip = `gleam-${versionSpec}-x86_64-pc-windows-msvc.zip` | |
| 26980 | − } else { | |
| 26981 | − zip = `gleam-${versionSpec}-windows-64bit.zip` | |
| 26982 | − } | |
| 50046 | + if (!Buffer.isBuffer(needle)) { | |
| 50047 | + throw new TypeError('The needle has to be a String or a Buffer.') | |
| 50048 | + } | |
| 26983 | 50049 | |
| 26984 | − return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${zip}` | |
| 26985 | − }, | |
| 26986 | − extract: async (file) => { | |
| 26987 | − const targetDir = await tc.extractZip(file) | |
| 50050 | + const needleLength = needle.length | |
| 26988 | 50051 | |
| 26989 | − return ['dir', targetDir] | |
| 26990 | − }, | |
| 26991 | − postExtract: async (cachePath) => { | |
| 26992 | − const bindir = path.join(cachePath, 'bin') | |
| 26993 | − const oldPath = path.join(cachePath, 'gleam.exe') | |
| 26994 | − const newPath = path.join(bindir, 'gleam.exe') | |
| 26995 | − fs.mkdirSync(bindir) | |
| 26996 | − fs.renameSync(oldPath, newPath) | |
| 26997 | − }, | |
| 26998 | − reportVersion: () => { | |
| 26999 | − const cmd = 'gleam.exe' | |
| 27000 | − const args = ['--version'] | |
| 27001 | − const env = {} | |
| 50052 | + if (needleLength === 0) { | |
| 50053 | + throw new Error('The needle cannot be an empty String/Buffer.') | |
| 50054 | + } | |
| 27002 | 50055 | |
| 27003 | − return [cmd, args, env] | |
| 27004 | − }, | |
| 27005 | − }, | |
| 50056 | + if (needleLength > 256) { | |
| 50057 | + throw new Error('The needle cannot have a length bigger than 256.') | |
| 50058 | + } | |
| 50059 | + | |
| 50060 | + this.maxMatches = Infinity | |
| 50061 | + this.matches = 0 | |
| 50062 | + | |
| 50063 | + this._occ = new Array(256) | |
| 50064 | + .fill(needleLength) // Initialize occurrence table. | |
| 50065 | + this._lookbehind_size = 0 | |
| 50066 | + this._needle = needle | |
| 50067 | + this._bufpos = 0 | |
| 50068 | + | |
| 50069 | + this._lookbehind = Buffer.alloc(needleLength) | |
| 50070 | + | |
| 50071 | + // Populate occurrence table with analysis of the needle, | |
| 50072 | + // ignoring last letter. | |
| 50073 | + for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var | |
| 50074 | + this._occ[needle[i]] = needleLength - 1 - i | |
| 50075 | + } | |
| 50076 | +} | |
| 50077 | +inherits(SBMH, EventEmitter) | |
| 50078 | + | |
| 50079 | +SBMH.prototype.reset = function () { | |
| 50080 | + this._lookbehind_size = 0 | |
| 50081 | + this.matches = 0 | |
| 50082 | + this._bufpos = 0 | |
| 50083 | +} | |
| 50084 | + | |
| 50085 | +SBMH.prototype.push = function (chunk, pos) { | |
| 50086 | + if (!Buffer.isBuffer(chunk)) { | |
| 50087 | + chunk = Buffer.from(chunk, 'binary') | |
| 50088 | + } | |
| 50089 | + const chlen = chunk.length | |
| 50090 | + this._bufpos = pos || 0 | |
| 50091 | + let r | |
| 50092 | + while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } | |
| 50093 | + return r | |
| 50094 | +} | |
| 50095 | + | |
| 50096 | +SBMH.prototype._sbmh_feed = function (data) { | |
| 50097 | + const len = data.length | |
| 50098 | + const needle = this._needle | |
| 50099 | + const needleLength = needle.length | |
| 50100 | + const lastNeedleChar = needle[needleLength - 1] | |
| 50101 | + | |
| 50102 | + // Positive: points to a position in `data` | |
| 50103 | + // pos == 3 points to data[3] | |
| 50104 | + // Negative: points to a position in the lookbehind buffer | |
| 50105 | + // pos == -2 points to lookbehind[lookbehind_size - 2] | |
| 50106 | + let pos = -this._lookbehind_size | |
| 50107 | + let ch | |
| 50108 | + | |
| 50109 | + if (pos < 0) { | |
| 50110 | + // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool | |
| 50111 | + // search with character lookup code that considers both the | |
| 50112 | + // lookbehind buffer and the current round's haystack data. | |
| 50113 | + // | |
| 50114 | + // Loop until | |
| 50115 | + // there is a match. | |
| 50116 | + // or until | |
| 50117 | + // we've moved past the position that requires the | |
| 50118 | + // lookbehind buffer. In this case we switch to the | |
| 50119 | + // optimized loop. | |
| 50120 | + // or until | |
| 50121 | + // the character to look at lies outside the haystack. | |
| 50122 | + while (pos < 0 && pos <= len - needleLength) { | |
| 50123 | + ch = this._sbmh_lookup_char(data, pos + needleLength - 1) | |
| 50124 | + | |
| 50125 | + if ( | |
| 50126 | + ch === lastNeedleChar && | |
| 50127 | + this._sbmh_memcmp(data, pos, needleLength - 1) | |
| 50128 | + ) { | |
| 50129 | + this._lookbehind_size = 0 | |
| 50130 | + ++this.matches | |
| 50131 | + this.emit('info', true) | |
| 50132 | + | |
| 50133 | + return (this._bufpos = pos + needleLength) | |
| 27006 | 50134 | } |
| 27007 | − installOpts.darwin = installOpts.linux | |
| 27008 | − break | |
| 27009 | − case 'rebar3': | |
| 27010 | − installOpts = { | |
| 27011 | − tool: 'Rebar3', | |
| 27012 | − linux: { | |
| 27013 | − downloadToolURL: () => { | |
| 27014 | − let url | |
| 27015 | − if (versionSpec === 'nightly') { | |
| 27016 | − url = 'https://s3.amazonaws.com/rebar3-nightly/rebar3' | |
| 27017 | − } else { | |
| 27018 | − url = `https://github.com/erlang/rebar3/releases/download/${versionSpec}/rebar3` | |
| 27019 | − } | |
| 50135 | + pos += this._occ[ch] | |
| 50136 | + } | |
| 27020 | 50137 | |
| 27021 | − return url | |
| 27022 | − }, | |
| 27023 | − extract: async () => ['file', 'rebar3'], | |
| 27024 | − postExtract: async (cachePath) => { | |
| 27025 | − const bindir = path.join(cachePath, 'bin') | |
| 27026 | − const oldPath = path.join(cachePath, 'rebar3') | |
| 27027 | − const newPath = path.join(bindir, 'rebar3') | |
| 27028 | − fs.mkdirSync(bindir, { recursive: true }) | |
| 27029 | − fs.renameSync(oldPath, newPath) | |
| 27030 | − fs.chmodSync(newPath, 0o755) | |
| 27031 | − }, | |
| 27032 | − reportVersion: () => { | |
| 27033 | − const cmd = 'rebar3' | |
| 27034 | − const args = ['version'] | |
| 27035 | − const env = { | |
| 27036 | − REBAR_GLOBAL_CONFIG_DIR: '/fake-dir', | |
| 27037 | − REBAR_CONFIG: 'fake.config', | |
| 27038 | − } | |
| 50138 | + // No match. | |
| 27039 | 50139 | |
| 27040 | − return [cmd, args, env] | |
| 27041 | − }, | |
| 27042 | − }, | |
| 27043 | − win32: { | |
| 27044 | − downloadToolURL: () => { | |
| 27045 | − let url | |
| 27046 | − if (versionSpec === 'nightly') { | |
| 27047 | − url = 'https://s3.amazonaws.com/rebar3-nightly/rebar3' | |
| 27048 | − } else { | |
| 27049 | − url = `https://github.com/erlang/rebar3/releases/download/${versionSpec}/rebar3` | |
| 50140 | + if (pos < 0) { | |
| 50141 | + // There's too few data for Boyer-Moore-Horspool to run, | |
| 50142 | + // so let's use a different algorithm to skip as much as | |
| 50143 | + // we can. | |
| 50144 | + // Forward pos until | |
| 50145 | + // the trailing part of lookbehind + data | |
| 50146 | + // looks like the beginning of the needle | |
| 50147 | + // or until | |
| 50148 | + // pos == 0 | |
| 50149 | + while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } | |
| 50150 | + } | |
| 50151 | + | |
| 50152 | + if (pos >= 0) { | |
| 50153 | + // Discard lookbehind buffer. | |
| 50154 | + this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) | |
| 50155 | + this._lookbehind_size = 0 | |
| 50156 | + } else { | |
| 50157 | + // Cut off part of the lookbehind buffer that has | |
| 50158 | + // been processed and append the entire haystack | |
| 50159 | + // into it. | |
| 50160 | + const bytesToCutOff = this._lookbehind_size + pos | |
| 50161 | + if (bytesToCutOff > 0) { | |
| 50162 | + // The cut off data is guaranteed not to contain the needle. | |
| 50163 | + this.emit('info', false, this._lookbehind, 0, bytesToCutOff) | |
| 50164 | + } | |
| 50165 | + | |
| 50166 | + this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, | |
| 50167 | + this._lookbehind_size - bytesToCutOff) | |
| 50168 | + this._lookbehind_size -= bytesToCutOff | |
| 50169 | + | |
| 50170 | + data.copy(this._lookbehind, this._lookbehind_size) | |
| 50171 | + this._lookbehind_size += len | |
| 50172 | + | |
| 50173 | + this._bufpos = len | |
| 50174 | + return len | |
| 50175 | + } | |
| 50176 | + } | |
| 50177 | + | |
| 50178 | + pos += (pos >= 0) * this._bufpos | |
| 50179 | + | |
| 50180 | + // Lookbehind buffer is now empty. We only need to check if the | |
| 50181 | + // needle is in the haystack. | |
| 50182 | + if (data.indexOf(needle, pos) !== -1) { | |
| 50183 | + pos = data.indexOf(needle, pos) | |
| 50184 | + ++this.matches | |
| 50185 | + if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } | |
| 50186 | + | |
| 50187 | + return (this._bufpos = pos + needleLength) | |
| 50188 | + } else { | |
| 50189 | + pos = len - needleLength | |
| 50190 | + } | |
| 50191 | + | |
| 50192 | + // There was no match. If there's trailing haystack data that we cannot | |
| 50193 | + // match yet using the Boyer-Moore-Horspool algorithm (because the trailing | |
| 50194 | + // data is less than the needle size) then match using a modified | |
| 50195 | + // algorithm that starts matching from the beginning instead of the end. | |
| 50196 | + // Whatever trailing data is left after running this algorithm is added to | |
| 50197 | + // the lookbehind buffer. | |
| 50198 | + while ( | |
| 50199 | + pos < len && | |
| 50200 | + ( | |
| 50201 | + data[pos] !== needle[0] || | |
| 50202 | + ( | |
| 50203 | + (Buffer.compare( | |
| 50204 | + data.subarray(pos, pos + len - pos), | |
| 50205 | + needle.subarray(0, len - pos) | |
| 50206 | + ) !== 0) | |
| 50207 | + ) | |
| 50208 | + ) | |
| 50209 | + ) { | |
| 50210 | + ++pos | |
| 50211 | + } | |
| 50212 | + if (pos < len) { | |
| 50213 | + data.copy(this._lookbehind, 0, pos, pos + (len - pos)) | |
| 50214 | + this._lookbehind_size = len - pos | |
| 50215 | + } | |
| 50216 | + | |
| 50217 | + // Everything until pos is guaranteed not to contain needle data. | |
| 50218 | + if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } | |
| 50219 | + | |
| 50220 | + this._bufpos = len | |
| 50221 | + return len | |
| 50222 | +} | |
| 50223 | + | |
| 50224 | +SBMH.prototype._sbmh_lookup_char = function (data, pos) { | |
| 50225 | + return (pos < 0) | |
| 50226 | + ? this._lookbehind[this._lookbehind_size + pos] | |
| 50227 | + : data[pos] | |
| 50228 | +} | |
| 50229 | + | |
| 50230 | +SBMH.prototype._sbmh_memcmp = function (data, pos, len) { | |
| 50231 | + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var | |
| 50232 | + if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } | |
| 50233 | + } | |
| 50234 | + return true | |
| 50235 | +} | |
| 50236 | + | |
| 50237 | +module.exports = SBMH | |
| 50238 | + | |
| 50239 | + | |
| 50240 | +/***/ }), | |
| 50241 | + | |
| 50242 | +/***/ 9581: | |
| 50243 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 50244 | + | |
| 50245 | +"use strict"; | |
| 50246 | + | |
| 50247 | + | |
| 50248 | +const WritableStream = (__nccwpck_require__(7075).Writable) | |
| 50249 | +const { inherits } = __nccwpck_require__(7975) | |
| 50250 | +const Dicer = __nccwpck_require__(7182) | |
| 50251 | + | |
| 50252 | +const MultipartParser = __nccwpck_require__(1192) | |
| 50253 | +const UrlencodedParser = __nccwpck_require__(855) | |
| 50254 | +const parseParams = __nccwpck_require__(8929) | |
| 50255 | + | |
| 50256 | +function Busboy (opts) { | |
| 50257 | + if (!(this instanceof Busboy)) { return new Busboy(opts) } | |
| 50258 | + | |
| 50259 | + if (typeof opts !== 'object') { | |
| 50260 | + throw new TypeError('Busboy expected an options-Object.') | |
| 50261 | + } | |
| 50262 | + if (typeof opts.headers !== 'object') { | |
| 50263 | + throw new TypeError('Busboy expected an options-Object with headers-attribute.') | |
| 50264 | + } | |
| 50265 | + if (typeof opts.headers['content-type'] !== 'string') { | |
| 50266 | + throw new TypeError('Missing Content-Type-header.') | |
| 50267 | + } | |
| 50268 | + | |
| 50269 | + const { | |
| 50270 | + headers, | |
| 50271 | + ...streamOptions | |
| 50272 | + } = opts | |
| 50273 | + | |
| 50274 | + this.opts = { | |
| 50275 | + autoDestroy: false, | |
| 50276 | + ...streamOptions | |
| 50277 | + } | |
| 50278 | + WritableStream.call(this, this.opts) | |
| 50279 | + | |
| 50280 | + this._done = false | |
| 50281 | + this._parser = this.getParserByHeaders(headers) | |
| 50282 | + this._finished = false | |
| 50283 | +} | |
| 50284 | +inherits(Busboy, WritableStream) | |
| 50285 | + | |
| 50286 | +Busboy.prototype.emit = function (ev) { | |
| 50287 | + if (ev === 'finish') { | |
| 50288 | + if (!this._done) { | |
| 50289 | + this._parser?.end() | |
| 50290 | + return | |
| 50291 | + } else if (this._finished) { | |
| 50292 | + return | |
| 50293 | + } | |
| 50294 | + this._finished = true | |
| 50295 | + } | |
| 50296 | + WritableStream.prototype.emit.apply(this, arguments) | |
| 50297 | +} | |
| 50298 | + | |
| 50299 | +Busboy.prototype.getParserByHeaders = function (headers) { | |
| 50300 | + const parsed = parseParams(headers['content-type']) | |
| 50301 | + | |
| 50302 | + const cfg = { | |
| 50303 | + defCharset: this.opts.defCharset, | |
| 50304 | + fileHwm: this.opts.fileHwm, | |
| 50305 | + headers, | |
| 50306 | + highWaterMark: this.opts.highWaterMark, | |
| 50307 | + isPartAFile: this.opts.isPartAFile, | |
| 50308 | + limits: this.opts.limits, | |
| 50309 | + parsedConType: parsed, | |
| 50310 | + preservePath: this.opts.preservePath | |
| 50311 | + } | |
| 50312 | + | |
| 50313 | + if (MultipartParser.detect.test(parsed[0])) { | |
| 50314 | + return new MultipartParser(this, cfg) | |
| 50315 | + } | |
| 50316 | + if (UrlencodedParser.detect.test(parsed[0])) { | |
| 50317 | + return new UrlencodedParser(this, cfg) | |
| 50318 | + } | |
| 50319 | + throw new Error('Unsupported Content-Type.') | |
| 50320 | +} | |
| 50321 | + | |
| 50322 | +Busboy.prototype._write = function (chunk, encoding, cb) { | |
| 50323 | + this._parser.write(chunk, cb) | |
| 50324 | +} | |
| 50325 | + | |
| 50326 | +module.exports = Busboy | |
| 50327 | +module.exports["default"] = Busboy | |
| 50328 | +module.exports.Busboy = Busboy | |
| 50329 | + | |
| 50330 | +module.exports.Dicer = Dicer | |
| 50331 | + | |
| 50332 | + | |
| 50333 | +/***/ }), | |
| 50334 | + | |
| 50335 | +/***/ 1192: | |
| 50336 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 50337 | + | |
| 50338 | +"use strict"; | |
| 50339 | + | |
| 50340 | + | |
| 50341 | +// TODO: | |
| 50342 | +// * support 1 nested multipart level | |
| 50343 | +// (see second multipart example here: | |
| 50344 | +// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) | |
| 50345 | +// * support limits.fieldNameSize | |
| 50346 | +// -- this will require modifications to utils.parseParams | |
| 50347 | + | |
| 50348 | +const { Readable } = __nccwpck_require__(7075) | |
| 50349 | +const { inherits } = __nccwpck_require__(7975) | |
| 50350 | + | |
| 50351 | +const Dicer = __nccwpck_require__(7182) | |
| 50352 | + | |
| 50353 | +const parseParams = __nccwpck_require__(8929) | |
| 50354 | +const decodeText = __nccwpck_require__(2747) | |
| 50355 | +const basename = __nccwpck_require__(692) | |
| 50356 | +const getLimit = __nccwpck_require__(2393) | |
| 50357 | + | |
| 50358 | +const RE_BOUNDARY = /^boundary$/i | |
| 50359 | +const RE_FIELD = /^form-data$/i | |
| 50360 | +const RE_CHARSET = /^charset$/i | |
| 50361 | +const RE_FILENAME = /^filename$/i | |
| 50362 | +const RE_NAME = /^name$/i | |
| 50363 | + | |
| 50364 | +Multipart.detect = /^multipart\/form-data/i | |
| 50365 | +function Multipart (boy, cfg) { | |
| 50366 | + let i | |
| 50367 | + let len | |
| 50368 | + const self = this | |
| 50369 | + let boundary | |
| 50370 | + const limits = cfg.limits | |
| 50371 | + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) | |
| 50372 | + const parsedConType = cfg.parsedConType || [] | |
| 50373 | + const defCharset = cfg.defCharset || 'utf8' | |
| 50374 | + const preservePath = cfg.preservePath | |
| 50375 | + const fileOpts = { highWaterMark: cfg.fileHwm } | |
| 50376 | + | |
| 50377 | + for (i = 0, len = parsedConType.length; i < len; ++i) { | |
| 50378 | + if (Array.isArray(parsedConType[i]) && | |
| 50379 | + RE_BOUNDARY.test(parsedConType[i][0])) { | |
| 50380 | + boundary = parsedConType[i][1] | |
| 50381 | + break | |
| 50382 | + } | |
| 50383 | + } | |
| 50384 | + | |
| 50385 | + function checkFinished () { | |
| 50386 | + if (nends === 0 && finished && !boy._done) { | |
| 50387 | + finished = false | |
| 50388 | + self.end() | |
| 50389 | + } | |
| 50390 | + } | |
| 50391 | + | |
| 50392 | + if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } | |
| 50393 | + | |
| 50394 | + const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) | |
| 50395 | + const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) | |
| 50396 | + const filesLimit = getLimit(limits, 'files', Infinity) | |
| 50397 | + const fieldsLimit = getLimit(limits, 'fields', Infinity) | |
| 50398 | + const partsLimit = getLimit(limits, 'parts', Infinity) | |
| 50399 | + const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) | |
| 50400 | + const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) | |
| 50401 | + | |
| 50402 | + let nfiles = 0 | |
| 50403 | + let nfields = 0 | |
| 50404 | + let nends = 0 | |
| 50405 | + let curFile | |
| 50406 | + let curField | |
| 50407 | + let finished = false | |
| 50408 | + | |
| 50409 | + this._needDrain = false | |
| 50410 | + this._pause = false | |
| 50411 | + this._cb = undefined | |
| 50412 | + this._nparts = 0 | |
| 50413 | + this._boy = boy | |
| 50414 | + | |
| 50415 | + const parserCfg = { | |
| 50416 | + boundary, | |
| 50417 | + maxHeaderPairs: headerPairsLimit, | |
| 50418 | + maxHeaderSize: headerSizeLimit, | |
| 50419 | + partHwm: fileOpts.highWaterMark, | |
| 50420 | + highWaterMark: cfg.highWaterMark | |
| 50421 | + } | |
| 50422 | + | |
| 50423 | + this.parser = new Dicer(parserCfg) | |
| 50424 | + this.parser.on('drain', function () { | |
| 50425 | + self._needDrain = false | |
| 50426 | + if (self._cb && !self._pause) { | |
| 50427 | + const cb = self._cb | |
| 50428 | + self._cb = undefined | |
| 50429 | + cb() | |
| 50430 | + } | |
| 50431 | + }).on('part', function onPart (part) { | |
| 50432 | + if (++self._nparts > partsLimit) { | |
| 50433 | + self.parser.removeListener('part', onPart) | |
| 50434 | + self.parser.on('part', skipPart) | |
| 50435 | + boy.hitPartsLimit = true | |
| 50436 | + boy.emit('partsLimit') | |
| 50437 | + return skipPart(part) | |
| 50438 | + } | |
| 50439 | + | |
| 50440 | + // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let | |
| 50441 | + // us emit 'end' early since we know the part has ended if we are already | |
| 50442 | + // seeing the next part | |
| 50443 | + if (curField) { | |
| 50444 | + const field = curField | |
| 50445 | + field.emit('end') | |
| 50446 | + field.removeAllListeners('end') | |
| 50447 | + } | |
| 50448 | + | |
| 50449 | + part.on('header', function (header) { | |
| 50450 | + let contype | |
| 50451 | + let fieldname | |
| 50452 | + let parsed | |
| 50453 | + let charset | |
| 50454 | + let encoding | |
| 50455 | + let filename | |
| 50456 | + let nsize = 0 | |
| 50457 | + | |
| 50458 | + if (header['content-type']) { | |
| 50459 | + parsed = parseParams(header['content-type'][0]) | |
| 50460 | + if (parsed[0]) { | |
| 50461 | + contype = parsed[0].toLowerCase() | |
| 50462 | + for (i = 0, len = parsed.length; i < len; ++i) { | |
| 50463 | + if (RE_CHARSET.test(parsed[i][0])) { | |
| 50464 | + charset = parsed[i][1].toLowerCase() | |
| 50465 | + break | |
| 27050 | 50466 | } |
| 50467 | + } | |
| 50468 | + } | |
| 50469 | + } | |
| 27051 | 50470 | |
| 27052 | − return url | |
| 27053 | − }, | |
| 27054 | − extract: async () => ['file', 'rebar3'], | |
| 27055 | − postExtract: async (cachePath) => { | |
| 27056 | − const bindir = path.join(cachePath, 'bin') | |
| 27057 | − const oldPath = path.join(cachePath, 'rebar3') | |
| 27058 | − const newPath = path.join(bindir, 'rebar3') | |
| 27059 | − fs.mkdirSync(bindir) | |
| 27060 | − fs.renameSync(oldPath, newPath) | |
| 27061 | − fs.chmodSync(newPath, 0o755) | |
| 50471 | + if (contype === undefined) { contype = 'text/plain' } | |
| 50472 | + if (charset === undefined) { charset = defCharset } | |
| 27062 | 50473 | |
| 27063 | − const ps1Filename = path.join(bindir, 'rebar3.ps1') | |
| 27064 | − fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) | |
| 50474 | + if (header['content-disposition']) { | |
| 50475 | + parsed = parseParams(header['content-disposition'][0]) | |
| 50476 | + if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } | |
| 50477 | + for (i = 0, len = parsed.length; i < len; ++i) { | |
| 50478 | + if (RE_NAME.test(parsed[i][0])) { | |
| 50479 | + fieldname = parsed[i][1] | |
| 50480 | + } else if (RE_FILENAME.test(parsed[i][0])) { | |
| 50481 | + filename = parsed[i][1] | |
| 50482 | + if (!preservePath) { filename = basename(filename) } | |
| 50483 | + } | |
| 50484 | + } | |
| 50485 | + } else { return skipPart(part) } | |
| 27065 | 50486 | |
| 27066 | − const cmdFilename = path.join(bindir, 'rebar3.cmd') | |
| 27067 | − fs.writeFileSync( | |
| 27068 | − cmdFilename, | |
| 27069 | − `@echo off\r\nescript.exe ${newPath} %*`, | |
| 27070 | − ) | |
| 27071 | − }, | |
| 27072 | − reportVersion: () => { | |
| 27073 | − const cmd = 'rebar3.cmd' | |
| 27074 | − const args = ['version'] | |
| 27075 | − const env = {} | |
| 50487 | + if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } | |
| 27076 | 50488 | |
| 27077 | − return [cmd, args, env] | |
| 27078 | − }, | |
| 27079 | − }, | |
| 27080 | − } | |
| 27081 | − installOpts.darwin = installOpts.linux | |
| 27082 | − break | |
| 27083 | − default: | |
| 27084 | − throw new Error(`no installer for ${toolName}`) | |
| 27085 | − } | |
| 50489 | + let onData, | |
| 50490 | + onEnd | |
| 27086 | 50491 | |
| 27087 | − await installTool({ toolName, versionSpec, installOpts }) | |
| 27088 | −} | |
| 50492 | + if (isPartAFile(fieldname, contype, filename)) { | |
| 50493 | + // file/binary field | |
| 50494 | + if (nfiles === filesLimit) { | |
| 50495 | + if (!boy.hitFilesLimit) { | |
| 50496 | + boy.hitFilesLimit = true | |
| 50497 | + boy.emit('filesLimit') | |
| 50498 | + } | |
| 50499 | + return skipPart(part) | |
| 50500 | + } | |
| 27089 | 50501 | |
| 27090 | −async function installTool(opts) { | |
| 27091 | − const { toolName, versionSpec, installOpts } = opts | |
| 27092 | − const platformOpts = installOpts[process.platform] || installOpts.all | |
| 27093 | − let cachePath = tc.find(toolName, versionSpec) | |
| 50502 | + ++nfiles | |
| 27094 | 50503 | |
| 27095 | − core.debug(`Checking if ${installOpts.tool} is already cached...`) | |
| 27096 | − if (cachePath === '') { | |
| 27097 | − core.debug(" ... it isn't!") | |
| 27098 | − const downloadToolURL = platformOpts.downloadToolURL(versionSpec) | |
| 27099 | − const file = await tc.downloadTool(downloadToolURL) | |
| 27100 | − const [targetElemType, targetElem] = await platformOpts.extract(file) | |
| 50504 | + if (boy.listenerCount('file') === 0) { | |
| 50505 | + self.parser._ignore() | |
| 50506 | + return | |
| 50507 | + } | |
| 27101 | 50508 | |
| 27102 | − if (targetElemType === 'dir') { | |
| 27103 | − cachePath = await tc.cacheDir(targetElem, toolName, versionSpec) | |
| 27104 | − } else if (targetElemType === 'file') { | |
| 27105 | − cachePath = await tc.cacheFile(file, targetElem, toolName, versionSpec) | |
| 27106 | − } | |
| 27107 | − } else { | |
| 27108 | − core.debug(` ... it is, at ${cachePath}`) | |
| 27109 | − } | |
| 50509 | + ++nends | |
| 50510 | + const file = new FileStream(fileOpts) | |
| 50511 | + curFile = file | |
| 50512 | + file.on('end', function () { | |
| 50513 | + --nends | |
| 50514 | + self._pause = false | |
| 50515 | + checkFinished() | |
| 50516 | + if (self._cb && !self._needDrain) { | |
| 50517 | + const cb = self._cb | |
| 50518 | + self._cb = undefined | |
| 50519 | + cb() | |
| 50520 | + } | |
| 50521 | + }) | |
| 50522 | + file._read = function (n) { | |
| 50523 | + if (!self._pause) { return } | |
| 50524 | + self._pause = false | |
| 50525 | + if (self._cb && !self._needDrain) { | |
| 50526 | + const cb = self._cb | |
| 50527 | + self._cb = undefined | |
| 50528 | + cb() | |
| 50529 | + } | |
| 50530 | + } | |
| 50531 | + boy.emit('file', fieldname, file, filename, encoding, contype) | |
| 27110 | 50532 | |
| 27111 | − // This makes sure we run, e.g. in Windows, the installer in the runner | |
| 27112 | − // We're not caching the install, just the downloaded tool | |
| 27113 | − const runnerToolPath = path.join( | |
| 27114 | − process.env.RUNNER_TEMP, | |
| 27115 | − '.setup-beam', | |
| 27116 | − toolName, | |
| 27117 | − ) | |
| 27118 | − fs.cpSync(cachePath, runnerToolPath, { recursive: true }) | |
| 50533 | + onData = function (data) { | |
| 50534 | + if ((nsize += data.length) > fileSizeLimit) { | |
| 50535 | + const extralen = fileSizeLimit - nsize + data.length | |
| 50536 | + if (extralen > 0) { file.push(data.slice(0, extralen)) } | |
| 50537 | + file.truncated = true | |
| 50538 | + file.bytesRead = fileSizeLimit | |
| 50539 | + part.removeAllListeners('data') | |
| 50540 | + file.emit('limit') | |
| 50541 | + return | |
| 50542 | + } else if (!file.push(data)) { self._pause = true } | |
| 27119 | 50543 | |
| 27120 | − core.debug('Performing post extract operations...') | |
| 27121 | − await platformOpts.postExtract(runnerToolPath) | |
| 50544 | + file.bytesRead = nsize | |
| 50545 | + } | |
| 27122 | 50546 | |
| 27123 | − core.debug(`Adding ${runnerToolPath}' bin to system path`) | |
| 27124 | − const runnerToolPathBin = path.join(runnerToolPath, 'bin') | |
| 27125 | − core.addPath(runnerToolPathBin) | |
| 50547 | + onEnd = function () { | |
| 50548 | + curFile = undefined | |
| 50549 | + file.push(null) | |
| 50550 | + } | |
| 50551 | + } else { | |
| 50552 | + // non-file field | |
| 50553 | + if (nfields === fieldsLimit) { | |
| 50554 | + if (!boy.hitFieldsLimit) { | |
| 50555 | + boy.hitFieldsLimit = true | |
| 50556 | + boy.emit('fieldsLimit') | |
| 50557 | + } | |
| 50558 | + return skipPart(part) | |
| 50559 | + } | |
| 27126 | 50560 | |
| 27127 | − const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() | |
| 27128 | − core.debug(`Exporting ${installDirForVarName} as ${runnerToolPath}`) | |
| 27129 | − core.exportVariable(installDirForVarName, runnerToolPath) | |
| 50561 | + ++nfields | |
| 50562 | + ++nends | |
| 50563 | + let buffer = '' | |
| 50564 | + let truncated = false | |
| 50565 | + curField = part | |
| 27130 | 50566 | |
| 27131 | − core.info(`Installed ${installOpts.tool} version`) | |
| 27132 | − const [cmd, args, env] = platformOpts.reportVersion() | |
| 27133 | − await exec(cmd, args, { env: { ...process.env, ...env } }) | |
| 27134 | −} | |
| 50567 | + onData = function (data) { | |
| 50568 | + if ((nsize += data.length) > fieldSizeLimit) { | |
| 50569 | + const extralen = (fieldSizeLimit - (nsize - data.length)) | |
| 50570 | + buffer += data.toString('binary', 0, extralen) | |
| 50571 | + truncated = true | |
| 50572 | + part.removeAllListeners('data') | |
| 50573 | + } else { buffer += data.toString('binary') } | |
| 50574 | + } | |
| 27135 | 50575 | |
| 27136 | −function checkOtpArchitecture() { | |
| 27137 | − const otpArch = otpArchitecture() | |
| 50576 | + onEnd = function () { | |
| 50577 | + curField = undefined | |
| 50578 | + if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } | |
| 50579 | + boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) | |
| 50580 | + --nends | |
| 50581 | + checkFinished() | |
| 50582 | + } | |
| 50583 | + } | |
| 27138 | 50584 | |
| 27139 | − if (process.platform !== 'win32' && otpArch == '32') { | |
| 27140 | − throw new Error( | |
| 27141 | − '@erlef/setup-beam only supports otp-architecture=32 on Windows', | |
| 27142 | − ) | |
| 50585 | + /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become | |
| 50586 | + broken. Streams2/streams3 is a huge black box of confusion, but | |
| 50587 | + somehow overriding the sync state seems to fix things again (and still | |
| 50588 | + seems to work for previous node versions). | |
| 50589 | + */ | |
| 50590 | + part._readableState.sync = false | |
| 50591 | + | |
| 50592 | + part.on('data', onData) | |
| 50593 | + part.on('end', onEnd) | |
| 50594 | + }).on('error', function (err) { | |
| 50595 | + if (curFile) { curFile.emit('error', err) } | |
| 50596 | + }) | |
| 50597 | + }).on('error', function (err) { | |
| 50598 | + boy.emit('error', err) | |
| 50599 | + }).on('finish', function () { | |
| 50600 | + finished = true | |
| 50601 | + checkFinished() | |
| 50602 | + }) | |
| 50603 | +} | |
| 50604 | + | |
| 50605 | +Multipart.prototype.write = function (chunk, cb) { | |
| 50606 | + const r = this.parser.write(chunk) | |
| 50607 | + if (r && !this._pause) { | |
| 50608 | + cb() | |
| 50609 | + } else { | |
| 50610 | + this._needDrain = !r | |
| 50611 | + this._cb = cb | |
| 27143 | 50612 | } |
| 50613 | +} | |
| 27144 | 50614 | |
| 27145 | − if (!['32', '64'].includes(otpArch)) { | |
| 27146 | − throw new Error('otp-architecture must be 32 or 64') | |
| 50615 | +Multipart.prototype.end = function () { | |
| 50616 | + const self = this | |
| 50617 | + | |
| 50618 | + if (self.parser.writable) { | |
| 50619 | + self.parser.end() | |
| 50620 | + } else if (!self._boy._done) { | |
| 50621 | + process.nextTick(function () { | |
| 50622 | + self._boy._done = true | |
| 50623 | + self._boy.emit('finish') | |
| 50624 | + }) | |
| 27147 | 50625 | } |
| 27148 | 50626 | } |
| 27149 | 50627 | |
| 27150 | −function debugLoggingEnabled() { | |
| 27151 | − return !!process.env.RUNNER_DEBUG | |
| 50628 | +function skipPart (part) { | |
| 50629 | + part.resume() | |
| 27152 | 50630 | } |
| 27153 | 50631 | |
| 27154 | −module.exports = { | |
| 27155 | − get, | |
| 27156 | − getElixirVersion, | |
| 27157 | − getGleamVersion, | |
| 27158 | − getOTPVersion, | |
| 27159 | − getRebar3Version, | |
| 27160 | − getVersionFromSpec, | |
| 27161 | − githubAMDRunnerArchs, | |
| 27162 | − githubARMRunnerArchs, | |
| 27163 | − install, | |
| 27164 | − installOTP, | |
| 27165 | − maybeInstallElixir, | |
| 27166 | − maybeInstallGleam, | |
| 27167 | − maybeInstallRebar3, | |
| 27168 | − parseVersionFile, | |
| 50632 | +function FileStream (opts) { | |
| 50633 | + Readable.call(this, opts) | |
| 50634 | + | |
| 50635 | + this.bytesRead = 0 | |
| 50636 | + | |
| 50637 | + this.truncated = false | |
| 27169 | 50638 | } |
| 27170 | 50639 | |
| 50640 | +inherits(FileStream, Readable) | |
| 27171 | 50641 | |
| 27172 | −/***/ }), | |
| 50642 | +FileStream.prototype._read = function (n) {} | |
| 27173 | 50643 | |
| 27174 | −/***/ 2613: | |
| 27175 | −/***/ ((module) => { | |
| 50644 | +module.exports = Multipart | |
| 27176 | 50645 | |
| 27177 | −"use strict"; | |
| 27178 | −module.exports = require("assert"); | |
| 27179 | 50646 | |
| 27180 | 50647 | /***/ }), |
| 27181 | 50648 | |
| 27182 | −/***/ 5317: | |
| 27183 | −/***/ ((module) => { | |
| 50649 | +/***/ 855: | |
| 50650 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27184 | 50651 | |
| 27185 | 50652 | "use strict"; |
| 27186 | −module.exports = require("child_process"); | |
| 27187 | 50653 | |
| 27188 | −/***/ }), | |
| 27189 | 50654 | |
| 27190 | −/***/ 6982: | |
| 27191 | −/***/ ((module) => { | |
| 50655 | +const Decoder = __nccwpck_require__(1496) | |
| 50656 | +const decodeText = __nccwpck_require__(2747) | |
| 50657 | +const getLimit = __nccwpck_require__(2393) | |
| 27192 | 50658 | |
| 27193 | −"use strict"; | |
| 27194 | −module.exports = require("crypto"); | |
| 50659 | +const RE_CHARSET = /^charset$/i | |
| 27195 | 50660 | |
| 27196 | −/***/ }), | |
| 50661 | +UrlEncoded.detect = /^application\/x-www-form-urlencoded/i | |
| 50662 | +function UrlEncoded (boy, cfg) { | |
| 50663 | + const limits = cfg.limits | |
| 50664 | + const parsedConType = cfg.parsedConType | |
| 50665 | + this.boy = boy | |
| 27197 | 50666 | |
| 27198 | −/***/ 4434: | |
| 27199 | −/***/ ((module) => { | |
| 50667 | + this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) | |
| 50668 | + this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) | |
| 50669 | + this.fieldsLimit = getLimit(limits, 'fields', Infinity) | |
| 27200 | 50670 | |
| 27201 | −"use strict"; | |
| 27202 | −module.exports = require("events"); | |
| 50671 | + let charset | |
| 50672 | + for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var | |
| 50673 | + if (Array.isArray(parsedConType[i]) && | |
| 50674 | + RE_CHARSET.test(parsedConType[i][0])) { | |
| 50675 | + charset = parsedConType[i][1].toLowerCase() | |
| 50676 | + break | |
| 50677 | + } | |
| 50678 | + } | |
| 27203 | 50679 | |
| 27204 | −/***/ }), | |
| 50680 | + if (charset === undefined) { charset = cfg.defCharset || 'utf8' } | |
| 27205 | 50681 | |
| 27206 | −/***/ 9896: | |
| 27207 | −/***/ ((module) => { | |
| 50682 | + this.decoder = new Decoder() | |
| 50683 | + this.charset = charset | |
| 50684 | + this._fields = 0 | |
| 50685 | + this._state = 'key' | |
| 50686 | + this._checkingBytes = true | |
| 50687 | + this._bytesKey = 0 | |
| 50688 | + this._bytesVal = 0 | |
| 50689 | + this._key = '' | |
| 50690 | + this._val = '' | |
| 50691 | + this._keyTrunc = false | |
| 50692 | + this._valTrunc = false | |
| 50693 | + this._hitLimit = false | |
| 50694 | +} | |
| 27208 | 50695 | |
| 27209 | −"use strict"; | |
| 27210 | −module.exports = require("fs"); | |
| 50696 | +UrlEncoded.prototype.write = function (data, cb) { | |
| 50697 | + if (this._fields === this.fieldsLimit) { | |
| 50698 | + if (!this.boy.hitFieldsLimit) { | |
| 50699 | + this.boy.hitFieldsLimit = true | |
| 50700 | + this.boy.emit('fieldsLimit') | |
| 50701 | + } | |
| 50702 | + return cb() | |
| 50703 | + } | |
| 27211 | 50704 | |
| 27212 | −/***/ }), | |
| 50705 | + let idxeq; let idxamp; let i; let p = 0; const len = data.length | |
| 27213 | 50706 | |
| 27214 | −/***/ 8611: | |
| 27215 | −/***/ ((module) => { | |
| 50707 | + while (p < len) { | |
| 50708 | + if (this._state === 'key') { | |
| 50709 | + idxeq = idxamp = undefined | |
| 50710 | + for (i = p; i < len; ++i) { | |
| 50711 | + if (!this._checkingBytes) { ++p } | |
| 50712 | + if (data[i] === 0x3D/* = */) { | |
| 50713 | + idxeq = i | |
| 50714 | + break | |
| 50715 | + } else if (data[i] === 0x26/* & */) { | |
| 50716 | + idxamp = i | |
| 50717 | + break | |
| 50718 | + } | |
| 50719 | + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { | |
| 50720 | + this._hitLimit = true | |
| 50721 | + break | |
| 50722 | + } else if (this._checkingBytes) { ++this._bytesKey } | |
| 50723 | + } | |
| 50724 | + | |
| 50725 | + if (idxeq !== undefined) { | |
| 50726 | + // key with assignment | |
| 50727 | + if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } | |
| 50728 | + this._state = 'val' | |
| 50729 | + | |
| 50730 | + this._hitLimit = false | |
| 50731 | + this._checkingBytes = true | |
| 50732 | + this._val = '' | |
| 50733 | + this._bytesVal = 0 | |
| 50734 | + this._valTrunc = false | |
| 50735 | + this.decoder.reset() | |
| 50736 | + | |
| 50737 | + p = idxeq + 1 | |
| 50738 | + } else if (idxamp !== undefined) { | |
| 50739 | + // key with no assignment | |
| 50740 | + ++this._fields | |
| 50741 | + let key; const keyTrunc = this._keyTrunc | |
| 50742 | + if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } | |
| 50743 | + | |
| 50744 | + this._hitLimit = false | |
| 50745 | + this._checkingBytes = true | |
| 50746 | + this._key = '' | |
| 50747 | + this._bytesKey = 0 | |
| 50748 | + this._keyTrunc = false | |
| 50749 | + this.decoder.reset() | |
| 50750 | + | |
| 50751 | + if (key.length) { | |
| 50752 | + this.boy.emit('field', decodeText(key, 'binary', this.charset), | |
| 50753 | + '', | |
| 50754 | + keyTrunc, | |
| 50755 | + false) | |
| 50756 | + } | |
| 50757 | + | |
| 50758 | + p = idxamp + 1 | |
| 50759 | + if (this._fields === this.fieldsLimit) { return cb() } | |
| 50760 | + } else if (this._hitLimit) { | |
| 50761 | + // we may not have hit the actual limit if there are encoded bytes... | |
| 50762 | + if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } | |
| 50763 | + p = i | |
| 50764 | + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { | |
| 50765 | + // yep, we actually did hit the limit | |
| 50766 | + this._checkingBytes = false | |
| 50767 | + this._keyTrunc = true | |
| 50768 | + } | |
| 50769 | + } else { | |
| 50770 | + if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } | |
| 50771 | + p = len | |
| 50772 | + } | |
| 50773 | + } else { | |
| 50774 | + idxamp = undefined | |
| 50775 | + for (i = p; i < len; ++i) { | |
| 50776 | + if (!this._checkingBytes) { ++p } | |
| 50777 | + if (data[i] === 0x26/* & */) { | |
| 50778 | + idxamp = i | |
| 50779 | + break | |
| 50780 | + } | |
| 50781 | + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { | |
| 50782 | + this._hitLimit = true | |
| 50783 | + break | |
| 50784 | + } else if (this._checkingBytes) { ++this._bytesVal } | |
| 50785 | + } | |
| 50786 | + | |
| 50787 | + if (idxamp !== undefined) { | |
| 50788 | + ++this._fields | |
| 50789 | + if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } | |
| 50790 | + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), | |
| 50791 | + decodeText(this._val, 'binary', this.charset), | |
| 50792 | + this._keyTrunc, | |
| 50793 | + this._valTrunc) | |
| 50794 | + this._state = 'key' | |
| 50795 | + | |
| 50796 | + this._hitLimit = false | |
| 50797 | + this._checkingBytes = true | |
| 50798 | + this._key = '' | |
| 50799 | + this._bytesKey = 0 | |
| 50800 | + this._keyTrunc = false | |
| 50801 | + this.decoder.reset() | |
| 50802 | + | |
| 50803 | + p = idxamp + 1 | |
| 50804 | + if (this._fields === this.fieldsLimit) { return cb() } | |
| 50805 | + } else if (this._hitLimit) { | |
| 50806 | + // we may not have hit the actual limit if there are encoded bytes... | |
| 50807 | + if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } | |
| 50808 | + p = i | |
| 50809 | + if ((this._val === '' && this.fieldSizeLimit === 0) || | |
| 50810 | + (this._bytesVal = this._val.length) === this.fieldSizeLimit) { | |
| 50811 | + // yep, we actually did hit the limit | |
| 50812 | + this._checkingBytes = false | |
| 50813 | + this._valTrunc = true | |
| 50814 | + } | |
| 50815 | + } else { | |
| 50816 | + if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } | |
| 50817 | + p = len | |
| 50818 | + } | |
| 50819 | + } | |
| 50820 | + } | |
| 50821 | + cb() | |
| 50822 | +} | |
| 27216 | 50823 | |
| 27217 | −"use strict"; | |
| 27218 | −module.exports = require("http"); | |
| 50824 | +UrlEncoded.prototype.end = function () { | |
| 50825 | + if (this.boy._done) { return } | |
| 27219 | 50826 | |
| 27220 | −/***/ }), | |
| 50827 | + if (this._state === 'key' && this._key.length > 0) { | |
| 50828 | + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), | |
| 50829 | + '', | |
| 50830 | + this._keyTrunc, | |
| 50831 | + false) | |
| 50832 | + } else if (this._state === 'val') { | |
| 50833 | + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), | |
| 50834 | + decodeText(this._val, 'binary', this.charset), | |
| 50835 | + this._keyTrunc, | |
| 50836 | + this._valTrunc) | |
| 50837 | + } | |
| 50838 | + this.boy._done = true | |
| 50839 | + this.boy.emit('finish') | |
| 50840 | +} | |
| 27221 | 50841 | |
| 27222 | −/***/ 5692: | |
| 27223 | −/***/ ((module) => { | |
| 50842 | +module.exports = UrlEncoded | |
| 27224 | 50843 | |
| 27225 | −"use strict"; | |
| 27226 | −module.exports = require("https"); | |
| 27227 | 50844 | |
| 27228 | 50845 | /***/ }), |
| 27229 | 50846 | |
| 27230 | −/***/ 9278: | |
| 50847 | +/***/ 1496: | |
| 27231 | 50848 | /***/ ((module) => { |
| 27232 | 50849 | |
| 27233 | 50850 | "use strict"; |
| 27234 | −module.exports = require("net"); | |
| 27235 | 50851 | |
| 27236 | −/***/ }), | |
| 27237 | 50852 | |
| 27238 | −/***/ 857: | |
| 27239 | −/***/ ((module) => { | |
| 50853 | +const RE_PLUS = /\+/g | |
| 27240 | 50854 | |
| 27241 | −"use strict"; | |
| 27242 | −module.exports = require("os"); | |
| 50855 | +const HEX = [ | |
| 50856 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50857 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50858 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50859 | + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, | |
| 50860 | + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50861 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50862 | + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 50863 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | |
| 50864 | +] | |
| 27243 | 50865 | |
| 27244 | −/***/ }), | |
| 50866 | +function Decoder () { | |
| 50867 | + this.buffer = undefined | |
| 50868 | +} | |
| 50869 | +Decoder.prototype.write = function (str) { | |
| 50870 | + // Replace '+' with ' ' before decoding | |
| 50871 | + str = str.replace(RE_PLUS, ' ') | |
| 50872 | + let res = '' | |
| 50873 | + let i = 0; let p = 0; const len = str.length | |
| 50874 | + for (; i < len; ++i) { | |
| 50875 | + if (this.buffer !== undefined) { | |
| 50876 | + if (!HEX[str.charCodeAt(i)]) { | |
| 50877 | + res += '%' + this.buffer | |
| 50878 | + this.buffer = undefined | |
| 50879 | + --i // retry character | |
| 50880 | + } else { | |
| 50881 | + this.buffer += str[i] | |
| 50882 | + ++p | |
| 50883 | + if (this.buffer.length === 2) { | |
| 50884 | + res += String.fromCharCode(parseInt(this.buffer, 16)) | |
| 50885 | + this.buffer = undefined | |
| 50886 | + } | |
| 50887 | + } | |
| 50888 | + } else if (str[i] === '%') { | |
| 50889 | + if (i > p) { | |
| 50890 | + res += str.substring(p, i) | |
| 50891 | + p = i | |
| 50892 | + } | |
| 50893 | + this.buffer = '' | |
| 50894 | + ++p | |
| 50895 | + } | |
| 50896 | + } | |
| 50897 | + if (p < len && this.buffer === undefined) { res += str.substring(p) } | |
| 50898 | + return res | |
| 50899 | +} | |
| 50900 | +Decoder.prototype.reset = function () { | |
| 50901 | + this.buffer = undefined | |
| 50902 | +} | |
| 27245 | 50903 | |
| 27246 | −/***/ 6928: | |
| 27247 | −/***/ ((module) => { | |
| 50904 | +module.exports = Decoder | |
| 27248 | 50905 | |
| 27249 | −"use strict"; | |
| 27250 | −module.exports = require("path"); | |
| 27251 | 50906 | |
| 27252 | 50907 | /***/ }), |
| 27253 | 50908 | |
| 27254 | −/***/ 2203: | |
| 50909 | +/***/ 692: | |
| 27255 | 50910 | /***/ ((module) => { |
| 27256 | 50911 | |
| 27257 | 50912 | "use strict"; |
| 27258 | −module.exports = require("stream"); | |
| 27259 | 50913 | |
| 27260 | −/***/ }), | |
| 27261 | 50914 | |
| 27262 | −/***/ 3193: | |
| 27263 | −/***/ ((module) => { | |
| 50915 | +module.exports = function basename (path) { | |
| 50916 | + if (typeof path !== 'string') { return '' } | |
| 50917 | + for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var | |
| 50918 | + switch (path.charCodeAt(i)) { | |
| 50919 | + case 0x2F: // '/' | |
| 50920 | + case 0x5C: // '\' | |
| 50921 | + path = path.slice(i + 1) | |
| 50922 | + return (path === '..' || path === '.' ? '' : path) | |
| 50923 | + } | |
| 50924 | + } | |
| 50925 | + return (path === '..' || path === '.' ? '' : path) | |
| 50926 | +} | |
| 27264 | 50927 | |
| 27265 | −"use strict"; | |
| 27266 | −module.exports = require("string_decoder"); | |
| 27267 | 50928 | |
| 27268 | 50929 | /***/ }), |
| 27269 | 50930 | |
| 27270 | −/***/ 3557: | |
| 27271 | −/***/ ((module) => { | |
| 50931 | +/***/ 2747: | |
| 50932 | +/***/ (function(module) { | |
| 27272 | 50933 | |
| 27273 | 50934 | "use strict"; |
| 27274 | −module.exports = require("timers"); | |
| 50935 | + | |
| 50936 | + | |
| 50937 | +// Node has always utf-8 | |
| 50938 | +const utf8Decoder = new TextDecoder('utf-8') | |
| 50939 | +const textDecoders = new Map([ | |
| 50940 | + ['utf-8', utf8Decoder], | |
| 50941 | + ['utf8', utf8Decoder] | |
| 50942 | +]) | |
| 50943 | + | |
| 50944 | +function getDecoder (charset) { | |
| 50945 | + let lc | |
| 50946 | + while (true) { | |
| 50947 | + switch (charset) { | |
| 50948 | + case 'utf-8': | |
| 50949 | + case 'utf8': | |
| 50950 | + return decoders.utf8 | |
| 50951 | + case 'latin1': | |
| 50952 | + case 'ascii': // TODO: Make these a separate, strict decoder? | |
| 50953 | + case 'us-ascii': | |
| 50954 | + case 'iso-8859-1': | |
| 50955 | + case 'iso8859-1': | |
| 50956 | + case 'iso88591': | |
| 50957 | + case 'iso_8859-1': | |
| 50958 | + case 'windows-1252': | |
| 50959 | + case 'iso_8859-1:1987': | |
| 50960 | + case 'cp1252': | |
| 50961 | + case 'x-cp1252': | |
| 50962 | + return decoders.latin1 | |
| 50963 | + case 'utf16le': | |
| 50964 | + case 'utf-16le': | |
| 50965 | + case 'ucs2': | |
| 50966 | + case 'ucs-2': | |
| 50967 | + return decoders.utf16le | |
| 50968 | + case 'base64': | |
| 50969 | + return decoders.base64 | |
| 50970 | + default: | |
| 50971 | + if (lc === undefined) { | |
| 50972 | + lc = true | |
| 50973 | + charset = charset.toLowerCase() | |
| 50974 | + continue | |
| 50975 | + } | |
| 50976 | + return decoders.other.bind(charset) | |
| 50977 | + } | |
| 50978 | + } | |
| 50979 | +} | |
| 50980 | + | |
| 50981 | +const decoders = { | |
| 50982 | + utf8: (data, sourceEncoding) => { | |
| 50983 | + if (data.length === 0) { | |
| 50984 | + return '' | |
| 50985 | + } | |
| 50986 | + if (typeof data === 'string') { | |
| 50987 | + data = Buffer.from(data, sourceEncoding) | |
| 50988 | + } | |
| 50989 | + return data.utf8Slice(0, data.length) | |
| 50990 | + }, | |
| 50991 | + | |
| 50992 | + latin1: (data, sourceEncoding) => { | |
| 50993 | + if (data.length === 0) { | |
| 50994 | + return '' | |
| 50995 | + } | |
| 50996 | + if (typeof data === 'string') { | |
| 50997 | + return data | |
| 50998 | + } | |
| 50999 | + return data.latin1Slice(0, data.length) | |
| 51000 | + }, | |
| 51001 | + | |
| 51002 | + utf16le: (data, sourceEncoding) => { | |
| 51003 | + if (data.length === 0) { | |
| 51004 | + return '' | |
| 51005 | + } | |
| 51006 | + if (typeof data === 'string') { | |
| 51007 | + data = Buffer.from(data, sourceEncoding) | |
| 51008 | + } | |
| 51009 | + return data.ucs2Slice(0, data.length) | |
| 51010 | + }, | |
| 51011 | + | |
| 51012 | + base64: (data, sourceEncoding) => { | |
| 51013 | + if (data.length === 0) { | |
| 51014 | + return '' | |
| 51015 | + } | |
| 51016 | + if (typeof data === 'string') { | |
| 51017 | + data = Buffer.from(data, sourceEncoding) | |
| 51018 | + } | |
| 51019 | + return data.base64Slice(0, data.length) | |
| 51020 | + }, | |
| 51021 | + | |
| 51022 | + other: (data, sourceEncoding) => { | |
| 51023 | + if (data.length === 0) { | |
| 51024 | + return '' | |
| 51025 | + } | |
| 51026 | + if (typeof data === 'string') { | |
| 51027 | + data = Buffer.from(data, sourceEncoding) | |
| 51028 | + } | |
| 51029 | + | |
| 51030 | + if (textDecoders.has(this.toString())) { | |
| 51031 | + try { | |
| 51032 | + return textDecoders.get(this).decode(data) | |
| 51033 | + } catch {} | |
| 51034 | + } | |
| 51035 | + return typeof data === 'string' | |
| 51036 | + ? data | |
| 51037 | + : data.toString() | |
| 51038 | + } | |
| 51039 | +} | |
| 51040 | + | |
| 51041 | +function decodeText (text, sourceEncoding, destEncoding) { | |
| 51042 | + if (text) { | |
| 51043 | + return getDecoder(destEncoding)(text, sourceEncoding) | |
| 51044 | + } | |
| 51045 | + return text | |
| 51046 | +} | |
| 51047 | + | |
| 51048 | +module.exports = decodeText | |
| 51049 | + | |
| 27275 | 51050 | |
| 27276 | 51051 | /***/ }), |
| 27277 | 51052 | |
| 27278 | −/***/ 4756: | |
| 51053 | +/***/ 2393: | |
| 27279 | 51054 | /***/ ((module) => { |
| 27280 | 51055 | |
| 27281 | 51056 | "use strict"; |
| 27282 | −module.exports = require("tls"); | |
| 51057 | + | |
| 51058 | + | |
| 51059 | +module.exports = function getLimit (limits, name, defaultLimit) { | |
| 51060 | + if ( | |
| 51061 | + !limits || | |
| 51062 | + limits[name] === undefined || | |
| 51063 | + limits[name] === null | |
| 51064 | + ) { return defaultLimit } | |
| 51065 | + | |
| 51066 | + if ( | |
| 51067 | + typeof limits[name] !== 'number' || | |
| 51068 | + isNaN(limits[name]) | |
| 51069 | + ) { throw new TypeError('Limit ' + name + ' is not a valid number') } | |
| 51070 | + | |
| 51071 | + return limits[name] | |
| 51072 | +} | |
| 51073 | + | |
| 27283 | 51074 | |
| 27284 | 51075 | /***/ }), |
| 27285 | 51076 | |
| 27286 | −/***/ 9023: | |
| 27287 | −/***/ ((module) => { | |
| 51077 | +/***/ 8929: | |
| 51078 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 27288 | 51079 | |
| 27289 | 51080 | "use strict"; |
| 27290 | −module.exports = require("util"); | |
| 51081 | +/* eslint-disable object-property-newline */ | |
| 51082 | + | |
| 51083 | + | |
| 51084 | +const decodeText = __nccwpck_require__(2747) | |
| 51085 | + | |
| 51086 | +const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g | |
| 51087 | + | |
| 51088 | +const EncodedLookup = { | |
| 51089 | + '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', | |
| 51090 | + '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', | |
| 51091 | + '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', | |
| 51092 | + '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', | |
| 51093 | + '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', | |
| 51094 | + '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', | |
| 51095 | + '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', | |
| 51096 | + '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', | |
| 51097 | + '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', | |
| 51098 | + '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', | |
| 51099 | + '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', | |
| 51100 | + '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', | |
| 51101 | + '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', | |
| 51102 | + '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', | |
| 51103 | + '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', | |
| 51104 | + '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', | |
| 51105 | + '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', | |
| 51106 | + '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', | |
| 51107 | + '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', | |
| 51108 | + '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', | |
| 51109 | + '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', | |
| 51110 | + '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', | |
| 51111 | + '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', | |
| 51112 | + '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', | |
| 51113 | + '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', | |
| 51114 | + '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', | |
| 51115 | + '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', | |
| 51116 | + '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', | |
| 51117 | + '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', | |
| 51118 | + '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', | |
| 51119 | + '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', | |
| 51120 | + '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', | |
| 51121 | + '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', | |
| 51122 | + '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', | |
| 51123 | + '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', | |
| 51124 | + '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', | |
| 51125 | + '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', | |
| 51126 | + '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', | |
| 51127 | + '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', | |
| 51128 | + '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', | |
| 51129 | + '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', | |
| 51130 | + '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', | |
| 51131 | + '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', | |
| 51132 | + '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', | |
| 51133 | + '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', | |
| 51134 | + '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', | |
| 51135 | + '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', | |
| 51136 | + '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', | |
| 51137 | + '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', | |
| 51138 | + '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', | |
| 51139 | + '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', | |
| 51140 | + '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', | |
| 51141 | + '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', | |
| 51142 | + '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', | |
| 51143 | + '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', | |
| 51144 | + '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', | |
| 51145 | + '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', | |
| 51146 | + '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', | |
| 51147 | + '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', | |
| 51148 | + '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', | |
| 51149 | + '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', | |
| 51150 | + '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', | |
| 51151 | + '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', | |
| 51152 | + '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', | |
| 51153 | + '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', | |
| 51154 | + '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', | |
| 51155 | + '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', | |
| 51156 | + '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', | |
| 51157 | + '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', | |
| 51158 | + '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', | |
| 51159 | + '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', | |
| 51160 | + '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', | |
| 51161 | + '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', | |
| 51162 | + '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', | |
| 51163 | + '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', | |
| 51164 | + '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', | |
| 51165 | + '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', | |
| 51166 | + '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', | |
| 51167 | + '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', | |
| 51168 | + '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', | |
| 51169 | + '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', | |
| 51170 | + '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', | |
| 51171 | + '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', | |
| 51172 | + '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', | |
| 51173 | + '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', | |
| 51174 | + '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', | |
| 51175 | + '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', | |
| 51176 | + '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', | |
| 51177 | + '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', | |
| 51178 | + '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', | |
| 51179 | + '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', | |
| 51180 | + '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', | |
| 51181 | + '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', | |
| 51182 | + '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', | |
| 51183 | + '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', | |
| 51184 | + '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', | |
| 51185 | + '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' | |
| 51186 | +} | |
| 51187 | + | |
| 51188 | +function encodedReplacer (match) { | |
| 51189 | + return EncodedLookup[match] | |
| 51190 | +} | |
| 51191 | + | |
| 51192 | +const STATE_KEY = 0 | |
| 51193 | +const STATE_VALUE = 1 | |
| 51194 | +const STATE_CHARSET = 2 | |
| 51195 | +const STATE_LANG = 3 | |
| 51196 | + | |
| 51197 | +function parseParams (str) { | |
| 51198 | + const res = [] | |
| 51199 | + let state = STATE_KEY | |
| 51200 | + let charset = '' | |
| 51201 | + let inquote = false | |
| 51202 | + let escaping = false | |
| 51203 | + let p = 0 | |
| 51204 | + let tmp = '' | |
| 51205 | + const len = str.length | |
| 51206 | + | |
| 51207 | + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var | |
| 51208 | + const char = str[i] | |
| 51209 | + if (char === '\\' && inquote) { | |
| 51210 | + if (escaping) { escaping = false } else { | |
| 51211 | + escaping = true | |
| 51212 | + continue | |
| 51213 | + } | |
| 51214 | + } else if (char === '"') { | |
| 51215 | + if (!escaping) { | |
| 51216 | + if (inquote) { | |
| 51217 | + inquote = false | |
| 51218 | + state = STATE_KEY | |
| 51219 | + } else { inquote = true } | |
| 51220 | + continue | |
| 51221 | + } else { escaping = false } | |
| 51222 | + } else { | |
| 51223 | + if (escaping && inquote) { tmp += '\\' } | |
| 51224 | + escaping = false | |
| 51225 | + if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { | |
| 51226 | + if (state === STATE_CHARSET) { | |
| 51227 | + state = STATE_LANG | |
| 51228 | + charset = tmp.substring(1) | |
| 51229 | + } else { state = STATE_VALUE } | |
| 51230 | + tmp = '' | |
| 51231 | + continue | |
| 51232 | + } else if (state === STATE_KEY && | |
| 51233 | + (char === '*' || char === '=') && | |
| 51234 | + res.length) { | |
| 51235 | + state = char === '*' | |
| 51236 | + ? STATE_CHARSET | |
| 51237 | + : STATE_VALUE | |
| 51238 | + res[p] = [tmp, undefined] | |
| 51239 | + tmp = '' | |
| 51240 | + continue | |
| 51241 | + } else if (!inquote && char === ';') { | |
| 51242 | + state = STATE_KEY | |
| 51243 | + if (charset) { | |
| 51244 | + if (tmp.length) { | |
| 51245 | + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), | |
| 51246 | + 'binary', | |
| 51247 | + charset) | |
| 51248 | + } | |
| 51249 | + charset = '' | |
| 51250 | + } else if (tmp.length) { | |
| 51251 | + tmp = decodeText(tmp, 'binary', 'utf8') | |
| 51252 | + } | |
| 51253 | + if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } | |
| 51254 | + tmp = '' | |
| 51255 | + ++p | |
| 51256 | + continue | |
| 51257 | + } else if (!inquote && (char === ' ' || char === '\t')) { continue } | |
| 51258 | + } | |
| 51259 | + tmp += char | |
| 51260 | + } | |
| 51261 | + if (charset && tmp.length) { | |
| 51262 | + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), | |
| 51263 | + 'binary', | |
| 51264 | + charset) | |
| 51265 | + } else if (tmp) { | |
| 51266 | + tmp = decodeText(tmp, 'binary', 'utf8') | |
| 51267 | + } | |
| 51268 | + | |
| 51269 | + if (res[p] === undefined) { | |
| 51270 | + if (tmp) { res[p] = tmp } | |
| 51271 | + } else { res[p][1] = tmp } | |
| 51272 | + | |
| 51273 | + return res | |
| 51274 | +} | |
| 51275 | + | |
| 51276 | +module.exports = parseParams | |
| 51277 | + | |
| 27291 | 51278 | |
| 27292 | 51279 | /***/ }), |
| 27293 | 51280 |
modified
package-lock.json
+920
−601
@@ -15,9 +15,9 @@
| 15 | 15 | "semver": "7.7.2" |
| 16 | 16 | }, |
| 17 | 17 | "devDependencies": { |
| 18 | − "@eslint/js": "9.38.0", | |
| 18 | + "@eslint/js": "10.0.1", | |
| 19 | 19 | "@vercel/ncc": "0.38.4", |
| 20 | − "eslint": "9.38.0", | |
| 20 | + "eslint": "10.0.1", | |
| 21 | 21 | "eslint-plugin-yml": "1.18.0", |
| 22 | 22 | "globals": "17.3.0", |
| 23 | 23 | "markdownlint-cli": "0.47.0", |
@@ -29,15 +29,6 @@
| 29 | 29 | "node": ">=20" |
| 30 | 30 | } |
| 31 | 31 | }, |
| 32 | − "node_modules/@aashutoshrathi/word-wrap": { | |
| 33 | − "version": "1.2.6", | |
| 34 | − "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", | |
| 35 | − "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", | |
| 36 | − "dev": true, | |
| 37 | − "engines": { | |
| 38 | − "node": ">=0.10.0" | |
| 39 | − } | |
| 40 | − }, | |
| 41 | 32 | "node_modules/@actions/core": { |
| 42 | 33 | "version": "1.11.1", |
| 43 | 34 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", |
@@ -52,22 +43,26 @@
| 52 | 43 | "version": "1.1.1", |
| 53 | 44 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", |
| 54 | 45 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", |
| 46 | + "license": "MIT", | |
| 55 | 47 | "dependencies": { |
| 56 | 48 | "@actions/io": "^1.0.1" |
| 57 | 49 | } |
| 58 | 50 | }, |
| 59 | 51 | "node_modules/@actions/http-client": { |
| 60 | − "version": "2.1.0", | |
| 61 | − "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", | |
| 62 | − "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", | |
| 52 | + "version": "2.2.3", | |
| 53 | + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", | |
| 54 | + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", | |
| 55 | + "license": "MIT", | |
| 63 | 56 | "dependencies": { |
| 64 | − "tunnel": "^0.0.6" | |
| 57 | + "tunnel": "^0.0.6", | |
| 58 | + "undici": "^5.25.4" | |
| 65 | 59 | } |
| 66 | 60 | }, |
| 67 | 61 | "node_modules/@actions/io": { |
| 68 | 62 | "version": "1.1.3", |
| 69 | 63 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", |
| 70 | − "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" | |
| 64 | + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", | |
| 65 | + "license": "MIT" | |
| 71 | 66 | }, |
| 72 | 67 | "node_modules/@actions/tool-cache": { |
| 73 | 68 | "version": "2.0.2", |
@@ -86,14 +81,15 @@
| 86 | 81 | "version": "6.3.1", |
| 87 | 82 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", |
| 88 | 83 | "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", |
| 84 | + "license": "ISC", | |
| 89 | 85 | "bin": { |
| 90 | 86 | "semver": "bin/semver.js" |
| 91 | 87 | } |
| 92 | 88 | }, |
| 93 | 89 | "node_modules/@borewit/text-codec": { |
| 94 | − "version": "0.1.1", | |
| 95 | − "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", | |
| 96 | − "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", | |
| 90 | + "version": "0.2.1", | |
| 91 | + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.1.tgz", | |
| 92 | + "integrity": "sha512-k7vvKPbf7J2fZ5klGRD9AeKfUvojuZIQ3BT5u7Jfv+puwXkUBUT5PVyMDfJZpy30CBDXGMgw7fguK/lpOMBvgw==", | |
| 97 | 93 | "dev": true, |
| 98 | 94 | "license": "MIT", |
| 99 | 95 | "funding": { |
@@ -102,9 +98,9 @@
| 102 | 98 | } |
| 103 | 99 | }, |
| 104 | 100 | "node_modules/@eslint-community/eslint-utils": { |
| 105 | − "version": "4.9.0", | |
| 106 | − "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", | |
| 107 | − "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", | |
| 101 | + "version": "4.9.1", | |
| 102 | + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", | |
| 103 | + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", | |
| 108 | 104 | "dev": true, |
| 109 | 105 | "license": "MIT", |
| 110 | 106 | "dependencies": { |
@@ -120,10 +116,23 @@
| 120 | 116 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" |
| 121 | 117 | } |
| 122 | 118 | }, |
| 119 | + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { | |
| 120 | + "version": "3.4.3", | |
| 121 | + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", | |
| 122 | + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", | |
| 123 | + "dev": true, | |
| 124 | + "license": "Apache-2.0", | |
| 125 | + "engines": { | |
| 126 | + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" | |
| 127 | + }, | |
| 128 | + "funding": { | |
| 129 | + "url": "https://opencollective.com/eslint" | |
| 130 | + } | |
| 131 | + }, | |
| 123 | 132 | "node_modules/@eslint-community/regexpp": { |
| 124 | − "version": "4.12.1", | |
| 125 | − "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", | |
| 126 | − "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", | |
| 133 | + "version": "4.12.2", | |
| 134 | + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", | |
| 135 | + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", | |
| 127 | 136 | "dev": true, |
| 128 | 137 | "license": "MIT", |
| 129 | 138 | "engines": { |
@@ -131,118 +140,98 @@
| 131 | 140 | } |
| 132 | 141 | }, |
| 133 | 142 | "node_modules/@eslint/config-array": { |
| 134 | − "version": "0.21.1", | |
| 135 | − "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", | |
| 136 | − "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", | |
| 143 | + "version": "0.23.2", | |
| 144 | + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.2.tgz", | |
| 145 | + "integrity": "sha512-YF+fE6LV4v5MGWRGj7G404/OZzGNepVF8fxk7jqmqo3lrza7a0uUcDnROGRBG1WFC1omYUS/Wp1f42i0M+3Q3A==", | |
| 137 | 146 | "dev": true, |
| 138 | 147 | "license": "Apache-2.0", |
| 139 | 148 | "dependencies": { |
| 140 | − "@eslint/object-schema": "^2.1.7", | |
| 149 | + "@eslint/object-schema": "^3.0.2", | |
| 141 | 150 | "debug": "^4.3.1", |
| 142 | − "minimatch": "^3.1.2" | |
| 151 | + "minimatch": "^10.2.1" | |
| 143 | 152 | }, |
| 144 | 153 | "engines": { |
| 145 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 154 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 146 | 155 | } |
| 147 | 156 | }, |
| 148 | 157 | "node_modules/@eslint/config-helpers": { |
| 149 | − "version": "0.4.1", | |
| 150 | − "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.1.tgz", | |
| 151 | − "integrity": "sha512-csZAzkNhsgwb0I/UAV6/RGFTbiakPCf0ZrGmrIxQpYvGZ00PhTkSnyKNolphgIvmnJeGw6rcGVEXfTzUnFuEvw==", | |
| 158 | + "version": "0.5.2", | |
| 159 | + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.2.tgz", | |
| 160 | + "integrity": "sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ==", | |
| 152 | 161 | "dev": true, |
| 153 | 162 | "license": "Apache-2.0", |
| 154 | 163 | "dependencies": { |
| 155 | − "@eslint/core": "^0.16.0" | |
| 164 | + "@eslint/core": "^1.1.0" | |
| 156 | 165 | }, |
| 157 | 166 | "engines": { |
| 158 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 167 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 159 | 168 | } |
| 160 | 169 | }, |
| 161 | 170 | "node_modules/@eslint/core": { |
| 162 | − "version": "0.16.0", | |
| 163 | − "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", | |
| 164 | − "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", | |
| 171 | + "version": "1.1.0", | |
| 172 | + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.0.tgz", | |
| 173 | + "integrity": "sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==", | |
| 165 | 174 | "dev": true, |
| 166 | 175 | "license": "Apache-2.0", |
| 167 | 176 | "dependencies": { |
| 168 | 177 | "@types/json-schema": "^7.0.15" |
| 169 | 178 | }, |
| 170 | 179 | "engines": { |
| 171 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 172 | − } | |
| 173 | − }, | |
| 174 | − "node_modules/@eslint/eslintrc": { | |
| 175 | − "version": "3.3.1", | |
| 176 | − "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", | |
| 177 | − "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", | |
| 178 | − "dev": true, | |
| 179 | − "license": "MIT", | |
| 180 | − "dependencies": { | |
| 181 | − "ajv": "^6.12.4", | |
| 182 | − "debug": "^4.3.2", | |
| 183 | − "espree": "^10.0.1", | |
| 184 | − "globals": "^14.0.0", | |
| 185 | − "ignore": "^5.2.0", | |
| 186 | − "import-fresh": "^3.2.1", | |
| 187 | − "js-yaml": "^4.1.0", | |
| 188 | − "minimatch": "^3.1.2", | |
| 189 | − "strip-json-comments": "^3.1.1" | |
| 190 | − }, | |
| 191 | − "engines": { | |
| 192 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 193 | − }, | |
| 194 | − "funding": { | |
| 195 | − "url": "https://opencollective.com/eslint" | |
| 196 | − } | |
| 197 | − }, | |
| 198 | − "node_modules/@eslint/eslintrc/node_modules/globals": { | |
| 199 | − "version": "14.0.0", | |
| 200 | − "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", | |
| 201 | − "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", | |
| 202 | − "dev": true, | |
| 203 | − "license": "MIT", | |
| 204 | − "engines": { | |
| 205 | − "node": ">=18" | |
| 206 | − }, | |
| 207 | − "funding": { | |
| 208 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 180 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 209 | 181 | } |
| 210 | 182 | }, |
| 211 | 183 | "node_modules/@eslint/js": { |
| 212 | − "version": "9.38.0", | |
| 213 | − "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", | |
| 214 | − "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", | |
| 184 | + "version": "10.0.1", | |
| 185 | + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", | |
| 186 | + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", | |
| 215 | 187 | "dev": true, |
| 216 | 188 | "license": "MIT", |
| 217 | 189 | "engines": { |
| 218 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 190 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 219 | 191 | }, |
| 220 | 192 | "funding": { |
| 221 | 193 | "url": "https://eslint.org/donate" |
| 194 | + }, | |
| 195 | + "peerDependencies": { | |
| 196 | + "eslint": "^10.0.0" | |
| 197 | + }, | |
| 198 | + "peerDependenciesMeta": { | |
| 199 | + "eslint": { | |
| 200 | + "optional": true | |
| 201 | + } | |
| 222 | 202 | } |
| 223 | 203 | }, |
| 224 | 204 | "node_modules/@eslint/object-schema": { |
| 225 | − "version": "2.1.7", | |
| 226 | − "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", | |
| 227 | − "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", | |
| 205 | + "version": "3.0.2", | |
| 206 | + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.2.tgz", | |
| 207 | + "integrity": "sha512-HOy56KJt48Bx8KmJ+XGQNSUMT/6dZee/M54XyUyuvTvPXJmsERRvBchsUVx1UMe1WwIH49XLAczNC7V2INsuUw==", | |
| 228 | 208 | "dev": true, |
| 229 | 209 | "license": "Apache-2.0", |
| 230 | 210 | "engines": { |
| 231 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 211 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 232 | 212 | } |
| 233 | 213 | }, |
| 234 | 214 | "node_modules/@eslint/plugin-kit": { |
| 235 | − "version": "0.4.0", | |
| 236 | − "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.0.tgz", | |
| 237 | − "integrity": "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==", | |
| 215 | + "version": "0.6.0", | |
| 216 | + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.0.tgz", | |
| 217 | + "integrity": "sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ==", | |
| 238 | 218 | "dev": true, |
| 239 | 219 | "license": "Apache-2.0", |
| 240 | 220 | "dependencies": { |
| 241 | − "@eslint/core": "^0.16.0", | |
| 221 | + "@eslint/core": "^1.1.0", | |
| 242 | 222 | "levn": "^0.4.1" |
| 243 | 223 | }, |
| 244 | 224 | "engines": { |
| 245 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 225 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 226 | + } | |
| 227 | + }, | |
| 228 | + "node_modules/@fastify/busboy": { | |
| 229 | + "version": "2.1.1", | |
| 230 | + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", | |
| 231 | + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", | |
| 232 | + "license": "MIT", | |
| 233 | + "engines": { | |
| 234 | + "node": ">=14" | |
| 246 | 235 | } |
| 247 | 236 | }, |
| 248 | 237 | "node_modules/@felipecrs/decompress-tarxz": { |
@@ -261,38 +250,6 @@
| 261 | 250 | "node": ">=20" |
| 262 | 251 | } |
| 263 | 252 | }, |
| 264 | − "node_modules/@felipecrs/decompress-tarxz/node_modules/file-type": { | |
| 265 | − "version": "20.5.0", | |
| 266 | − "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", | |
| 267 | − "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", | |
| 268 | − "dev": true, | |
| 269 | − "license": "MIT", | |
| 270 | − "dependencies": { | |
| 271 | − "@tokenizer/inflate": "^0.2.6", | |
| 272 | − "strtok3": "^10.2.0", | |
| 273 | − "token-types": "^6.0.0", | |
| 274 | − "uint8array-extras": "^1.4.0" | |
| 275 | − }, | |
| 276 | − "engines": { | |
| 277 | − "node": ">=18" | |
| 278 | − }, | |
| 279 | − "funding": { | |
| 280 | − "url": "https://github.com/sindresorhus/file-type?sponsor=1" | |
| 281 | − } | |
| 282 | − }, | |
| 283 | − "node_modules/@felipecrs/decompress-tarxz/node_modules/is-stream": { | |
| 284 | − "version": "2.0.1", | |
| 285 | − "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", | |
| 286 | − "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", | |
| 287 | − "dev": true, | |
| 288 | − "license": "MIT", | |
| 289 | − "engines": { | |
| 290 | − "node": ">=8" | |
| 291 | − }, | |
| 292 | − "funding": { | |
| 293 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 294 | − } | |
| 295 | − }, | |
| 296 | 253 | "node_modules/@humanfs/core": { |
| 297 | 254 | "version": "0.19.1", |
| 298 | 255 | "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", |
@@ -304,38 +261,25 @@
| 304 | 261 | } |
| 305 | 262 | }, |
| 306 | 263 | "node_modules/@humanfs/node": { |
| 307 | − "version": "0.16.6", | |
| 308 | − "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", | |
| 309 | − "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", | |
| 264 | + "version": "0.16.7", | |
| 265 | + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", | |
| 266 | + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", | |
| 310 | 267 | "dev": true, |
| 311 | 268 | "license": "Apache-2.0", |
| 312 | 269 | "dependencies": { |
| 313 | 270 | "@humanfs/core": "^0.19.1", |
| 314 | − "@humanwhocodes/retry": "^0.3.0" | |
| 271 | + "@humanwhocodes/retry": "^0.4.0" | |
| 315 | 272 | }, |
| 316 | 273 | "engines": { |
| 317 | 274 | "node": ">=18.18.0" |
| 318 | 275 | } |
| 319 | 276 | }, |
| 320 | − "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { | |
| 321 | − "version": "0.3.1", | |
| 322 | − "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", | |
| 323 | − "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", | |
| 324 | − "dev": true, | |
| 325 | − "license": "Apache-2.0", | |
| 326 | − "engines": { | |
| 327 | − "node": ">=18.18" | |
| 328 | − }, | |
| 329 | − "funding": { | |
| 330 | − "type": "github", | |
| 331 | − "url": "https://github.com/sponsors/nzakas" | |
| 332 | − } | |
| 333 | − }, | |
| 334 | 277 | "node_modules/@humanwhocodes/module-importer": { |
| 335 | 278 | "version": "1.0.1", |
| 336 | 279 | "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", |
| 337 | 280 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", |
| 338 | 281 | "dev": true, |
| 282 | + "license": "Apache-2.0", | |
| 339 | 283 | "engines": { |
| 340 | 284 | "node": ">=12.22" |
| 341 | 285 | }, |
@@ -394,10 +338,17 @@
| 394 | 338 | "@types/ms": "*" |
| 395 | 339 | } |
| 396 | 340 | }, |
| 341 | + "node_modules/@types/esrecurse": { | |
| 342 | + "version": "4.3.1", | |
| 343 | + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", | |
| 344 | + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", | |
| 345 | + "dev": true, | |
| 346 | + "license": "MIT" | |
| 347 | + }, | |
| 397 | 348 | "node_modules/@types/estree": { |
| 398 | − "version": "1.0.7", | |
| 399 | − "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", | |
| 400 | − "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", | |
| 349 | + "version": "1.0.8", | |
| 350 | + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", | |
| 351 | + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", | |
| 401 | 352 | "dev": true, |
| 402 | 353 | "license": "MIT" |
| 403 | 354 | }, |
@@ -454,50 +405,6 @@
| 454 | 405 | "node": ">=18" |
| 455 | 406 | } |
| 456 | 407 | }, |
| 457 | − "node_modules/@xhmikosr/decompress-tar/node_modules/file-type": { | |
| 458 | − "version": "20.5.0", | |
| 459 | − "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", | |
| 460 | − "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", | |
| 461 | − "dev": true, | |
| 462 | − "license": "MIT", | |
| 463 | − "dependencies": { | |
| 464 | − "@tokenizer/inflate": "^0.2.6", | |
| 465 | − "strtok3": "^10.2.0", | |
| 466 | − "token-types": "^6.0.0", | |
| 467 | − "uint8array-extras": "^1.4.0" | |
| 468 | − }, | |
| 469 | − "engines": { | |
| 470 | − "node": ">=18" | |
| 471 | − }, | |
| 472 | − "funding": { | |
| 473 | − "url": "https://github.com/sindresorhus/file-type?sponsor=1" | |
| 474 | − } | |
| 475 | − }, | |
| 476 | − "node_modules/@xhmikosr/decompress-tar/node_modules/is-stream": { | |
| 477 | − "version": "2.0.1", | |
| 478 | − "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", | |
| 479 | − "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", | |
| 480 | − "dev": true, | |
| 481 | − "license": "MIT", | |
| 482 | − "engines": { | |
| 483 | − "node": ">=8" | |
| 484 | − }, | |
| 485 | − "funding": { | |
| 486 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 487 | − } | |
| 488 | − }, | |
| 489 | − "node_modules/@xhmikosr/decompress-tar/node_modules/tar-stream": { | |
| 490 | − "version": "3.1.7", | |
| 491 | − "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", | |
| 492 | − "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", | |
| 493 | − "dev": true, | |
| 494 | − "license": "MIT", | |
| 495 | − "dependencies": { | |
| 496 | − "b4a": "^1.6.4", | |
| 497 | − "fast-fifo": "^1.2.0", | |
| 498 | − "streamx": "^2.15.0" | |
| 499 | − } | |
| 500 | − }, | |
| 501 | 408 | "node_modules/@xhmikosr/decompress-unzip": { |
| 502 | 409 | "version": "7.1.0", |
| 503 | 410 | "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-unzip/-/decompress-unzip-7.1.0.tgz", |
@@ -513,56 +420,10 @@
| 513 | 420 | "node": ">=18" |
| 514 | 421 | } |
| 515 | 422 | }, |
| 516 | − "node_modules/@xhmikosr/decompress-unzip/node_modules/file-type": { | |
| 517 | − "version": "20.5.0", | |
| 518 | − "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", | |
| 519 | − "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", | |
| 520 | − "dev": true, | |
| 521 | − "license": "MIT", | |
| 522 | − "dependencies": { | |
| 523 | − "@tokenizer/inflate": "^0.2.6", | |
| 524 | − "strtok3": "^10.2.0", | |
| 525 | − "token-types": "^6.0.0", | |
| 526 | − "uint8array-extras": "^1.4.0" | |
| 527 | − }, | |
| 528 | − "engines": { | |
| 529 | − "node": ">=18" | |
| 530 | − }, | |
| 531 | − "funding": { | |
| 532 | − "url": "https://github.com/sindresorhus/file-type?sponsor=1" | |
| 533 | − } | |
| 534 | − }, | |
| 535 | − "node_modules/@xhmikosr/decompress-unzip/node_modules/get-stream": { | |
| 536 | − "version": "6.0.1", | |
| 537 | − "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", | |
| 538 | − "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", | |
| 539 | − "dev": true, | |
| 540 | − "license": "MIT", | |
| 541 | − "engines": { | |
| 542 | − "node": ">=10" | |
| 543 | − }, | |
| 544 | − "funding": { | |
| 545 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 546 | − } | |
| 547 | − }, | |
| 548 | − "node_modules/@xhmikosr/decompress-unzip/node_modules/yauzl": { | |
| 549 | − "version": "3.2.0", | |
| 550 | − "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.2.0.tgz", | |
| 551 | − "integrity": "sha512-Ow9nuGZE+qp1u4JIPvg+uCiUr7xGQWdff7JQSk5VGYTAZMDe2q8lxJ10ygv10qmSj031Ty/6FNJpLO4o1Sgc+w==", | |
| 552 | − "dev": true, | |
| 553 | − "license": "MIT", | |
| 554 | − "dependencies": { | |
| 555 | − "buffer-crc32": "~0.2.3", | |
| 556 | − "pend": "~1.2.0" | |
| 557 | − }, | |
| 558 | − "engines": { | |
| 559 | − "node": ">=12" | |
| 560 | − } | |
| 561 | − }, | |
| 562 | 423 | "node_modules/acorn": { |
| 563 | − "version": "8.15.0", | |
| 564 | − "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", | |
| 565 | − "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", | |
| 424 | + "version": "8.16.0", | |
| 425 | + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", | |
| 426 | + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", | |
| 566 | 427 | "dev": true, |
| 567 | 428 | "license": "MIT", |
| 568 | 429 | "bin": { |
@@ -612,48 +473,146 @@
| 612 | 473 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" |
| 613 | 474 | } |
| 614 | 475 | }, |
| 615 | − "node_modules/ansi-styles": { | |
| 616 | − "version": "4.3.0", | |
| 617 | − "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", | |
| 618 | − "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", | |
| 476 | + "node_modules/argparse": { | |
| 477 | + "version": "2.0.1", | |
| 478 | + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", | |
| 479 | + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", | |
| 480 | + "dev": true, | |
| 481 | + "license": "Python-2.0" | |
| 482 | + }, | |
| 483 | + "node_modules/available-typed-arrays": { | |
| 484 | + "version": "1.0.7", | |
| 485 | + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", | |
| 486 | + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", | |
| 619 | 487 | "dev": true, |
| 488 | + "license": "MIT", | |
| 620 | 489 | "dependencies": { |
| 621 | − "color-convert": "^2.0.1" | |
| 490 | + "possible-typed-array-names": "^1.0.0" | |
| 622 | 491 | }, |
| 623 | 492 | "engines": { |
| 624 | − "node": ">=8" | |
| 493 | + "node": ">= 0.4" | |
| 625 | 494 | }, |
| 626 | 495 | "funding": { |
| 627 | − "url": "https://github.com/chalk/ansi-styles?sponsor=1" | |
| 496 | + "url": "https://github.com/sponsors/ljharb" | |
| 628 | 497 | } |
| 629 | 498 | }, |
| 630 | − "node_modules/argparse": { | |
| 631 | − "version": "2.0.1", | |
| 632 | − "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", | |
| 633 | − "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", | |
| 634 | − "dev": true | |
| 635 | − }, | |
| 636 | 499 | "node_modules/b4a": { |
| 637 | − "version": "1.6.7", | |
| 638 | − "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", | |
| 639 | − "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", | |
| 500 | + "version": "1.8.0", | |
| 501 | + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz", | |
| 502 | + "integrity": "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==", | |
| 640 | 503 | "dev": true, |
| 641 | − "license": "Apache-2.0" | |
| 504 | + "license": "Apache-2.0", | |
| 505 | + "peerDependencies": { | |
| 506 | + "react-native-b4a": "*" | |
| 507 | + }, | |
| 508 | + "peerDependenciesMeta": { | |
| 509 | + "react-native-b4a": { | |
| 510 | + "optional": true | |
| 511 | + } | |
| 512 | + } | |
| 642 | 513 | }, |
| 643 | 514 | "node_modules/balanced-match": { |
| 644 | − "version": "1.0.2", | |
| 645 | − "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", | |
| 646 | − "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", | |
| 515 | + "version": "4.0.4", | |
| 516 | + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", | |
| 517 | + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", | |
| 647 | 518 | "dev": true, |
| 648 | − "license": "MIT" | |
| 519 | + "license": "MIT", | |
| 520 | + "engines": { | |
| 521 | + "node": "18 || 20 || >=22" | |
| 522 | + } | |
| 649 | 523 | }, |
| 650 | 524 | "node_modules/bare-events": { |
| 651 | − "version": "2.6.1", | |
| 652 | − "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.1.tgz", | |
| 653 | − "integrity": "sha512-AuTJkq9XmE6Vk0FJVNq5QxETrSA/vKHarWVBG5l/JbdCL1prJemiyJqUS0jrlXO0MftuPq4m3YVYhoNc5+aE/g==", | |
| 525 | + "version": "2.8.2", | |
| 526 | + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz", | |
| 527 | + "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==", | |
| 528 | + "dev": true, | |
| 529 | + "license": "Apache-2.0", | |
| 530 | + "peerDependencies": { | |
| 531 | + "bare-abort-controller": "*" | |
| 532 | + }, | |
| 533 | + "peerDependenciesMeta": { | |
| 534 | + "bare-abort-controller": { | |
| 535 | + "optional": true | |
| 536 | + } | |
| 537 | + } | |
| 538 | + }, | |
| 539 | + "node_modules/bare-fs": { | |
| 540 | + "version": "4.5.5", | |
| 541 | + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.5.tgz", | |
| 542 | + "integrity": "sha512-XvwYM6VZqKoqDll8BmSww5luA5eflDzY0uEFfBJtFKe4PAAtxBjU3YIxzIBzhyaEQBy1VXEQBto4cpN5RZJw+w==", | |
| 543 | + "dev": true, | |
| 544 | + "license": "Apache-2.0", | |
| 545 | + "dependencies": { | |
| 546 | + "bare-events": "^2.5.4", | |
| 547 | + "bare-path": "^3.0.0", | |
| 548 | + "bare-stream": "^2.6.4", | |
| 549 | + "bare-url": "^2.2.2", | |
| 550 | + "fast-fifo": "^1.3.2" | |
| 551 | + }, | |
| 552 | + "engines": { | |
| 553 | + "bare": ">=1.16.0" | |
| 554 | + }, | |
| 555 | + "peerDependencies": { | |
| 556 | + "bare-buffer": "*" | |
| 557 | + }, | |
| 558 | + "peerDependenciesMeta": { | |
| 559 | + "bare-buffer": { | |
| 560 | + "optional": true | |
| 561 | + } | |
| 562 | + } | |
| 563 | + }, | |
| 564 | + "node_modules/bare-os": { | |
| 565 | + "version": "3.7.0", | |
| 566 | + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.7.0.tgz", | |
| 567 | + "integrity": "sha512-64Rcwj8qlnTZU8Ps6JJEdSmxBEUGgI7g8l+lMtsJLl4IsfTcHMTfJ188u2iGV6P6YPRZrtv72B2kjn+hp+Yv3g==", | |
| 568 | + "dev": true, | |
| 569 | + "license": "Apache-2.0", | |
| 570 | + "engines": { | |
| 571 | + "bare": ">=1.14.0" | |
| 572 | + } | |
| 573 | + }, | |
| 574 | + "node_modules/bare-path": { | |
| 575 | + "version": "3.0.0", | |
| 576 | + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", | |
| 577 | + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", | |
| 578 | + "dev": true, | |
| 579 | + "license": "Apache-2.0", | |
| 580 | + "dependencies": { | |
| 581 | + "bare-os": "^3.0.1" | |
| 582 | + } | |
| 583 | + }, | |
| 584 | + "node_modules/bare-stream": { | |
| 585 | + "version": "2.8.0", | |
| 586 | + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.8.0.tgz", | |
| 587 | + "integrity": "sha512-reUN0M2sHRqCdG4lUK3Fw8w98eeUIZHL5c3H7Mbhk2yVBL+oofgaIp0ieLfD5QXwPCypBpmEEKU2WZKzbAk8GA==", | |
| 588 | + "dev": true, | |
| 589 | + "license": "Apache-2.0", | |
| 590 | + "dependencies": { | |
| 591 | + "streamx": "^2.21.0", | |
| 592 | + "teex": "^1.0.1" | |
| 593 | + }, | |
| 594 | + "peerDependencies": { | |
| 595 | + "bare-buffer": "*", | |
| 596 | + "bare-events": "*" | |
| 597 | + }, | |
| 598 | + "peerDependenciesMeta": { | |
| 599 | + "bare-buffer": { | |
| 600 | + "optional": true | |
| 601 | + }, | |
| 602 | + "bare-events": { | |
| 603 | + "optional": true | |
| 604 | + } | |
| 605 | + } | |
| 606 | + }, | |
| 607 | + "node_modules/bare-url": { | |
| 608 | + "version": "2.3.2", | |
| 609 | + "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz", | |
| 610 | + "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==", | |
| 654 | 611 | "dev": true, |
| 655 | 612 | "license": "Apache-2.0", |
| 656 | − "optional": true | |
| 613 | + "dependencies": { | |
| 614 | + "bare-path": "^3.0.0" | |
| 615 | + } | |
| 657 | 616 | }, |
| 658 | 617 | "node_modules/base64-js": { |
| 659 | 618 | "version": "1.5.1", |
@@ -673,13 +632,15 @@
| 673 | 632 | "type": "consulting", |
| 674 | 633 | "url": "https://feross.org/support" |
| 675 | 634 | } |
| 676 | − ] | |
| 635 | + ], | |
| 636 | + "license": "MIT" | |
| 677 | 637 | }, |
| 678 | 638 | "node_modules/bl": { |
| 679 | 639 | "version": "1.2.3", |
| 680 | 640 | "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", |
| 681 | 641 | "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", |
| 682 | 642 | "dev": true, |
| 643 | + "license": "MIT", | |
| 683 | 644 | "dependencies": { |
| 684 | 645 | "readable-stream": "^2.3.5", |
| 685 | 646 | "safe-buffer": "^5.1.1" |
@@ -689,17 +650,21 @@
| 689 | 650 | "version": "3.2.0", |
| 690 | 651 | "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", |
| 691 | 652 | "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", |
| 692 | − "dev": true | |
| 653 | + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", | |
| 654 | + "dev": true, | |
| 655 | + "license": "MIT" | |
| 693 | 656 | }, |
| 694 | 657 | "node_modules/brace-expansion": { |
| 695 | − "version": "1.1.12", | |
| 696 | − "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", | |
| 697 | − "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", | |
| 658 | + "version": "5.0.4", | |
| 659 | + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", | |
| 660 | + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", | |
| 698 | 661 | "dev": true, |
| 699 | 662 | "license": "MIT", |
| 700 | 663 | "dependencies": { |
| 701 | − "balanced-match": "^1.0.0", | |
| 702 | − "concat-map": "0.0.1" | |
| 664 | + "balanced-match": "^4.0.2" | |
| 665 | + }, | |
| 666 | + "engines": { | |
| 667 | + "node": "18 || 20 || >=22" | |
| 703 | 668 | } |
| 704 | 669 | }, |
| 705 | 670 | "node_modules/buffer": { |
@@ -721,6 +686,7 @@
| 721 | 686 | "url": "https://feross.org/support" |
| 722 | 687 | } |
| 723 | 688 | ], |
| 689 | + "license": "MIT", | |
| 724 | 690 | "dependencies": { |
| 725 | 691 | "base64-js": "^1.3.1", |
| 726 | 692 | "ieee754": "^1.1.13" |
@@ -731,6 +697,7 @@
| 731 | 697 | "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", |
| 732 | 698 | "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", |
| 733 | 699 | "dev": true, |
| 700 | + "license": "MIT", | |
| 734 | 701 | "dependencies": { |
| 735 | 702 | "buffer-alloc-unsafe": "^1.1.0", |
| 736 | 703 | "buffer-fill": "^1.0.0" |
@@ -740,13 +707,15 @@
| 740 | 707 | "version": "1.1.0", |
| 741 | 708 | "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", |
| 742 | 709 | "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", |
| 743 | − "dev": true | |
| 710 | + "dev": true, | |
| 711 | + "license": "MIT" | |
| 744 | 712 | }, |
| 745 | 713 | "node_modules/buffer-crc32": { |
| 746 | 714 | "version": "0.2.13", |
| 747 | 715 | "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", |
| 748 | 716 | "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", |
| 749 | 717 | "dev": true, |
| 718 | + "license": "MIT", | |
| 750 | 719 | "engines": { |
| 751 | 720 | "node": "*" |
| 752 | 721 | } |
@@ -755,32 +724,57 @@
| 755 | 724 | "version": "1.0.0", |
| 756 | 725 | "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", |
| 757 | 726 | "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", |
| 758 | − "dev": true | |
| 727 | + "dev": true, | |
| 728 | + "license": "MIT" | |
| 759 | 729 | }, |
| 760 | − "node_modules/callsites": { | |
| 761 | − "version": "3.1.0", | |
| 762 | − "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", | |
| 763 | − "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", | |
| 730 | + "node_modules/call-bind": { | |
| 731 | + "version": "1.0.8", | |
| 732 | + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", | |
| 733 | + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", | |
| 764 | 734 | "dev": true, |
| 765 | 735 | "license": "MIT", |
| 736 | + "dependencies": { | |
| 737 | + "call-bind-apply-helpers": "^1.0.0", | |
| 738 | + "es-define-property": "^1.0.0", | |
| 739 | + "get-intrinsic": "^1.2.4", | |
| 740 | + "set-function-length": "^1.2.2" | |
| 741 | + }, | |
| 766 | 742 | "engines": { |
| 767 | − "node": ">=6" | |
| 743 | + "node": ">= 0.4" | |
| 744 | + }, | |
| 745 | + "funding": { | |
| 746 | + "url": "https://github.com/sponsors/ljharb" | |
| 747 | + } | |
| 748 | + }, | |
| 749 | + "node_modules/call-bind-apply-helpers": { | |
| 750 | + "version": "1.0.2", | |
| 751 | + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", | |
| 752 | + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", | |
| 753 | + "dev": true, | |
| 754 | + "license": "MIT", | |
| 755 | + "dependencies": { | |
| 756 | + "es-errors": "^1.3.0", | |
| 757 | + "function-bind": "^1.1.2" | |
| 758 | + }, | |
| 759 | + "engines": { | |
| 760 | + "node": ">= 0.4" | |
| 768 | 761 | } |
| 769 | 762 | }, |
| 770 | − "node_modules/chalk": { | |
| 771 | − "version": "4.1.2", | |
| 772 | − "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", | |
| 773 | − "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", | |
| 763 | + "node_modules/call-bound": { | |
| 764 | + "version": "1.0.4", | |
| 765 | + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", | |
| 766 | + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", | |
| 774 | 767 | "dev": true, |
| 768 | + "license": "MIT", | |
| 775 | 769 | "dependencies": { |
| 776 | − "ansi-styles": "^4.1.0", | |
| 777 | − "supports-color": "^7.1.0" | |
| 770 | + "call-bind-apply-helpers": "^1.0.2", | |
| 771 | + "get-intrinsic": "^1.3.0" | |
| 778 | 772 | }, |
| 779 | 773 | "engines": { |
| 780 | − "node": ">=10" | |
| 774 | + "node": ">= 0.4" | |
| 781 | 775 | }, |
| 782 | 776 | "funding": { |
| 783 | − "url": "https://github.com/chalk/chalk?sponsor=1" | |
| 777 | + "url": "https://github.com/sponsors/ljharb" | |
| 784 | 778 | } |
| 785 | 779 | }, |
| 786 | 780 | "node_modules/character-entities": { |
@@ -816,24 +810,6 @@
| 816 | 810 | "url": "https://github.com/sponsors/wooorm" |
| 817 | 811 | } |
| 818 | 812 | }, |
| 819 | − "node_modules/color-convert": { | |
| 820 | − "version": "2.0.1", | |
| 821 | − "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", | |
| 822 | − "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", | |
| 823 | − "dev": true, | |
| 824 | − "dependencies": { | |
| 825 | − "color-name": "~1.1.4" | |
| 826 | − }, | |
| 827 | − "engines": { | |
| 828 | − "node": ">=7.0.0" | |
| 829 | − } | |
| 830 | − }, | |
| 831 | − "node_modules/color-name": { | |
| 832 | − "version": "1.1.4", | |
| 833 | − "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", | |
| 834 | − "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", | |
| 835 | − "dev": true | |
| 836 | − }, | |
| 837 | 813 | "node_modules/commander": { |
| 838 | 814 | "version": "14.0.3", |
| 839 | 815 | "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", |
@@ -844,18 +820,12 @@
| 844 | 820 | "node": ">=20" |
| 845 | 821 | } |
| 846 | 822 | }, |
| 847 | − "node_modules/concat-map": { | |
| 848 | − "version": "0.0.1", | |
| 849 | − "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", | |
| 850 | − "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", | |
| 851 | − "dev": true, | |
| 852 | − "license": "MIT" | |
| 853 | − }, | |
| 854 | 823 | "node_modules/core-util-is": { |
| 855 | 824 | "version": "1.0.3", |
| 856 | 825 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", |
| 857 | 826 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", |
| 858 | − "dev": true | |
| 827 | + "dev": true, | |
| 828 | + "license": "MIT" | |
| 859 | 829 | }, |
| 860 | 830 | "node_modules/cross-spawn": { |
| 861 | 831 | "version": "7.0.6", |
@@ -879,9 +849,9 @@
| 879 | 849 | "license": "MIT" |
| 880 | 850 | }, |
| 881 | 851 | "node_modules/debug": { |
| 882 | − "version": "4.4.1", | |
| 883 | − "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", | |
| 884 | − "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", | |
| 852 | + "version": "4.4.3", | |
| 853 | + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", | |
| 854 | + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", | |
| 885 | 855 | "dev": true, |
| 886 | 856 | "license": "MIT", |
| 887 | 857 | "dependencies": { |
@@ -915,6 +885,7 @@
| 915 | 885 | "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz", |
| 916 | 886 | "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==", |
| 917 | 887 | "dev": true, |
| 888 | + "license": "MIT", | |
| 918 | 889 | "dependencies": { |
| 919 | 890 | "decompress-tar": "^4.0.0", |
| 920 | 891 | "decompress-tarbz2": "^4.0.0", |
@@ -934,6 +905,7 @@
| 934 | 905 | "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", |
| 935 | 906 | "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", |
| 936 | 907 | "dev": true, |
| 908 | + "license": "MIT", | |
| 937 | 909 | "dependencies": { |
| 938 | 910 | "file-type": "^5.2.0", |
| 939 | 911 | "is-stream": "^1.1.0", |
@@ -943,11 +915,51 @@
| 943 | 915 | "node": ">=4" |
| 944 | 916 | } |
| 945 | 917 | }, |
| 918 | + "node_modules/decompress-tar/node_modules/file-type": { | |
| 919 | + "version": "5.2.0", | |
| 920 | + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", | |
| 921 | + "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", | |
| 922 | + "dev": true, | |
| 923 | + "license": "MIT", | |
| 924 | + "engines": { | |
| 925 | + "node": ">=4" | |
| 926 | + } | |
| 927 | + }, | |
| 928 | + "node_modules/decompress-tar/node_modules/is-stream": { | |
| 929 | + "version": "1.1.0", | |
| 930 | + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", | |
| 931 | + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", | |
| 932 | + "dev": true, | |
| 933 | + "license": "MIT", | |
| 934 | + "engines": { | |
| 935 | + "node": ">=0.10.0" | |
| 936 | + } | |
| 937 | + }, | |
| 938 | + "node_modules/decompress-tar/node_modules/tar-stream": { | |
| 939 | + "version": "1.6.2", | |
| 940 | + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", | |
| 941 | + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", | |
| 942 | + "dev": true, | |
| 943 | + "license": "MIT", | |
| 944 | + "dependencies": { | |
| 945 | + "bl": "^1.0.0", | |
| 946 | + "buffer-alloc": "^1.2.0", | |
| 947 | + "end-of-stream": "^1.0.0", | |
| 948 | + "fs-constants": "^1.0.0", | |
| 949 | + "readable-stream": "^2.3.0", | |
| 950 | + "to-buffer": "^1.1.1", | |
| 951 | + "xtend": "^4.0.0" | |
| 952 | + }, | |
| 953 | + "engines": { | |
| 954 | + "node": ">= 0.8.0" | |
| 955 | + } | |
| 956 | + }, | |
| 946 | 957 | "node_modules/decompress-tarbz2": { |
| 947 | 958 | "version": "4.1.1", |
| 948 | 959 | "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", |
| 949 | 960 | "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", |
| 950 | 961 | "dev": true, |
| 962 | + "license": "MIT", | |
| 951 | 963 | "dependencies": { |
| 952 | 964 | "decompress-tar": "^4.1.0", |
| 953 | 965 | "file-type": "^6.1.0", |
@@ -964,15 +976,27 @@
| 964 | 976 | "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", |
| 965 | 977 | "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", |
| 966 | 978 | "dev": true, |
| 979 | + "license": "MIT", | |
| 967 | 980 | "engines": { |
| 968 | 981 | "node": ">=4" |
| 969 | 982 | } |
| 970 | 983 | }, |
| 984 | + "node_modules/decompress-tarbz2/node_modules/is-stream": { | |
| 985 | + "version": "1.1.0", | |
| 986 | + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", | |
| 987 | + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", | |
| 988 | + "dev": true, | |
| 989 | + "license": "MIT", | |
| 990 | + "engines": { | |
| 991 | + "node": ">=0.10.0" | |
| 992 | + } | |
| 993 | + }, | |
| 971 | 994 | "node_modules/decompress-targz": { |
| 972 | 995 | "version": "4.1.1", |
| 973 | 996 | "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", |
| 974 | 997 | "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", |
| 975 | 998 | "dev": true, |
| 999 | + "license": "MIT", | |
| 976 | 1000 | "dependencies": { |
| 977 | 1001 | "decompress-tar": "^4.1.1", |
| 978 | 1002 | "file-type": "^5.2.0", |
@@ -982,11 +1006,32 @@
| 982 | 1006 | "node": ">=4" |
| 983 | 1007 | } |
| 984 | 1008 | }, |
| 1009 | + "node_modules/decompress-targz/node_modules/file-type": { | |
| 1010 | + "version": "5.2.0", | |
| 1011 | + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", | |
| 1012 | + "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", | |
| 1013 | + "dev": true, | |
| 1014 | + "license": "MIT", | |
| 1015 | + "engines": { | |
| 1016 | + "node": ">=4" | |
| 1017 | + } | |
| 1018 | + }, | |
| 1019 | + "node_modules/decompress-targz/node_modules/is-stream": { | |
| 1020 | + "version": "1.1.0", | |
| 1021 | + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", | |
| 1022 | + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", | |
| 1023 | + "dev": true, | |
| 1024 | + "license": "MIT", | |
| 1025 | + "engines": { | |
| 1026 | + "node": ">=0.10.0" | |
| 1027 | + } | |
| 1028 | + }, | |
| 985 | 1029 | "node_modules/decompress-unzip": { |
| 986 | 1030 | "version": "4.0.1", |
| 987 | 1031 | "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", |
| 988 | 1032 | "integrity": "sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw==", |
| 989 | 1033 | "dev": true, |
| 1034 | + "license": "MIT", | |
| 990 | 1035 | "dependencies": { |
| 991 | 1036 | "file-type": "^3.8.0", |
| 992 | 1037 | "get-stream": "^2.2.0", |
@@ -1002,10 +1047,36 @@
| 1002 | 1047 | "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", |
| 1003 | 1048 | "integrity": "sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==", |
| 1004 | 1049 | "dev": true, |
| 1050 | + "license": "MIT", | |
| 1051 | + "engines": { | |
| 1052 | + "node": ">=0.10.0" | |
| 1053 | + } | |
| 1054 | + }, | |
| 1055 | + "node_modules/decompress-unzip/node_modules/get-stream": { | |
| 1056 | + "version": "2.3.1", | |
| 1057 | + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", | |
| 1058 | + "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", | |
| 1059 | + "dev": true, | |
| 1060 | + "license": "MIT", | |
| 1061 | + "dependencies": { | |
| 1062 | + "object-assign": "^4.0.1", | |
| 1063 | + "pinkie-promise": "^2.0.0" | |
| 1064 | + }, | |
| 1005 | 1065 | "engines": { |
| 1006 | 1066 | "node": ">=0.10.0" |
| 1007 | 1067 | } |
| 1008 | 1068 | }, |
| 1069 | + "node_modules/decompress-unzip/node_modules/yauzl": { | |
| 1070 | + "version": "2.10.0", | |
| 1071 | + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", | |
| 1072 | + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", | |
| 1073 | + "dev": true, | |
| 1074 | + "license": "MIT", | |
| 1075 | + "dependencies": { | |
| 1076 | + "buffer-crc32": "~0.2.3", | |
| 1077 | + "fd-slicer": "~1.1.0" | |
| 1078 | + } | |
| 1079 | + }, | |
| 1009 | 1080 | "node_modules/deep-extend": { |
| 1010 | 1081 | "version": "0.6.0", |
| 1011 | 1082 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", |
@@ -1020,20 +1091,25 @@
| 1020 | 1091 | "version": "0.1.4", |
| 1021 | 1092 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", |
| 1022 | 1093 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", |
| 1023 | − "dev": true | |
| 1094 | + "dev": true, | |
| 1095 | + "license": "MIT" | |
| 1024 | 1096 | }, |
| 1025 | 1097 | "node_modules/define-data-property": { |
| 1026 | − "version": "1.1.1", | |
| 1027 | − "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", | |
| 1028 | − "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", | |
| 1098 | + "version": "1.1.4", | |
| 1099 | + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", | |
| 1100 | + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", | |
| 1029 | 1101 | "dev": true, |
| 1102 | + "license": "MIT", | |
| 1030 | 1103 | "dependencies": { |
| 1031 | − "get-intrinsic": "^1.2.1", | |
| 1032 | − "gopd": "^1.0.1", | |
| 1033 | − "has-property-descriptors": "^1.0.0" | |
| 1104 | + "es-define-property": "^1.0.0", | |
| 1105 | + "es-errors": "^1.3.0", | |
| 1106 | + "gopd": "^1.0.1" | |
| 1034 | 1107 | }, |
| 1035 | 1108 | "engines": { |
| 1036 | 1109 | "node": ">= 0.4" |
| 1110 | + }, | |
| 1111 | + "funding": { | |
| 1112 | + "url": "https://github.com/sponsors/ljharb" | |
| 1037 | 1113 | } |
| 1038 | 1114 | }, |
| 1039 | 1115 | "node_modules/define-properties": { |
@@ -1041,6 +1117,7 @@
| 1041 | 1117 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", |
| 1042 | 1118 | "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", |
| 1043 | 1119 | "dev": true, |
| 1120 | + "license": "MIT", | |
| 1044 | 1121 | "dependencies": { |
| 1045 | 1122 | "define-data-property": "^1.0.1", |
| 1046 | 1123 | "has-property-descriptors": "^1.0.0", |
@@ -1067,7 +1144,8 @@
| 1067 | 1144 | "version": "2.1.0", |
| 1068 | 1145 | "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", |
| 1069 | 1146 | "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", |
| 1070 | − "dev": true | |
| 1147 | + "dev": true, | |
| 1148 | + "license": "MIT" | |
| 1071 | 1149 | }, |
| 1072 | 1150 | "node_modules/devlop": { |
| 1073 | 1151 | "version": "1.1.0", |
@@ -1083,11 +1161,27 @@
| 1083 | 1161 | "url": "https://github.com/sponsors/wooorm" |
| 1084 | 1162 | } |
| 1085 | 1163 | }, |
| 1164 | + "node_modules/dunder-proto": { | |
| 1165 | + "version": "1.0.1", | |
| 1166 | + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", | |
| 1167 | + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", | |
| 1168 | + "dev": true, | |
| 1169 | + "license": "MIT", | |
| 1170 | + "dependencies": { | |
| 1171 | + "call-bind-apply-helpers": "^1.0.1", | |
| 1172 | + "es-errors": "^1.3.0", | |
| 1173 | + "gopd": "^1.2.0" | |
| 1174 | + }, | |
| 1175 | + "engines": { | |
| 1176 | + "node": ">= 0.4" | |
| 1177 | + } | |
| 1178 | + }, | |
| 1086 | 1179 | "node_modules/end-of-stream": { |
| 1087 | − "version": "1.4.4", | |
| 1088 | − "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", | |
| 1089 | − "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", | |
| 1180 | + "version": "1.4.5", | |
| 1181 | + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", | |
| 1182 | + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", | |
| 1090 | 1183 | "dev": true, |
| 1184 | + "license": "MIT", | |
| 1091 | 1185 | "dependencies": { |
| 1092 | 1186 | "once": "^1.4.0" |
| 1093 | 1187 | } |
@@ -1118,17 +1212,52 @@
| 1118 | 1212 | "node": ">=18" |
| 1119 | 1213 | } |
| 1120 | 1214 | }, |
| 1215 | + "node_modules/es-define-property": { | |
| 1216 | + "version": "1.0.1", | |
| 1217 | + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", | |
| 1218 | + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", | |
| 1219 | + "dev": true, | |
| 1220 | + "license": "MIT", | |
| 1221 | + "engines": { | |
| 1222 | + "node": ">= 0.4" | |
| 1223 | + } | |
| 1224 | + }, | |
| 1225 | + "node_modules/es-errors": { | |
| 1226 | + "version": "1.3.0", | |
| 1227 | + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", | |
| 1228 | + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", | |
| 1229 | + "dev": true, | |
| 1230 | + "license": "MIT", | |
| 1231 | + "engines": { | |
| 1232 | + "node": ">= 0.4" | |
| 1233 | + } | |
| 1234 | + }, | |
| 1235 | + "node_modules/es-object-atoms": { | |
| 1236 | + "version": "1.1.1", | |
| 1237 | + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", | |
| 1238 | + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", | |
| 1239 | + "dev": true, | |
| 1240 | + "license": "MIT", | |
| 1241 | + "dependencies": { | |
| 1242 | + "es-errors": "^1.3.0" | |
| 1243 | + }, | |
| 1244 | + "engines": { | |
| 1245 | + "node": ">= 0.4" | |
| 1246 | + } | |
| 1247 | + }, | |
| 1121 | 1248 | "node_modules/es6-error": { |
| 1122 | 1249 | "version": "4.1.1", |
| 1123 | 1250 | "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", |
| 1124 | 1251 | "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", |
| 1125 | − "dev": true | |
| 1252 | + "dev": true, | |
| 1253 | + "license": "MIT" | |
| 1126 | 1254 | }, |
| 1127 | 1255 | "node_modules/escape-string-regexp": { |
| 1128 | 1256 | "version": "4.0.0", |
| 1129 | 1257 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", |
| 1130 | 1258 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", |
| 1131 | 1259 | "dev": true, |
| 1260 | + "license": "MIT", | |
| 1132 | 1261 | "engines": { |
| 1133 | 1262 | "node": ">=10" |
| 1134 | 1263 | }, |
@@ -1137,33 +1266,30 @@
| 1137 | 1266 | } |
| 1138 | 1267 | }, |
| 1139 | 1268 | "node_modules/eslint": { |
| 1140 | − "version": "9.38.0", | |
| 1141 | − "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", | |
| 1142 | − "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", | |
| 1269 | + "version": "10.0.1", | |
| 1270 | + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.0.1.tgz", | |
| 1271 | + "integrity": "sha512-20MV9SUdeN6Jd84xESsKhRly+/vxI+hwvpBMA93s+9dAcjdCuCojn4IqUGS3lvVaqjVYGYHSRMCpeFtF2rQYxQ==", | |
| 1143 | 1272 | "dev": true, |
| 1144 | 1273 | "license": "MIT", |
| 1145 | 1274 | "dependencies": { |
| 1146 | 1275 | "@eslint-community/eslint-utils": "^4.8.0", |
| 1147 | − "@eslint-community/regexpp": "^4.12.1", | |
| 1148 | − "@eslint/config-array": "^0.21.1", | |
| 1149 | − "@eslint/config-helpers": "^0.4.1", | |
| 1150 | − "@eslint/core": "^0.16.0", | |
| 1151 | − "@eslint/eslintrc": "^3.3.1", | |
| 1152 | − "@eslint/js": "9.38.0", | |
| 1153 | − "@eslint/plugin-kit": "^0.4.0", | |
| 1276 | + "@eslint-community/regexpp": "^4.12.2", | |
| 1277 | + "@eslint/config-array": "^0.23.2", | |
| 1278 | + "@eslint/config-helpers": "^0.5.2", | |
| 1279 | + "@eslint/core": "^1.1.0", | |
| 1280 | + "@eslint/plugin-kit": "^0.6.0", | |
| 1154 | 1281 | "@humanfs/node": "^0.16.6", |
| 1155 | 1282 | "@humanwhocodes/module-importer": "^1.0.1", |
| 1156 | 1283 | "@humanwhocodes/retry": "^0.4.2", |
| 1157 | 1284 | "@types/estree": "^1.0.6", |
| 1158 | 1285 | "ajv": "^6.12.4", |
| 1159 | − "chalk": "^4.0.0", | |
| 1160 | 1286 | "cross-spawn": "^7.0.6", |
| 1161 | 1287 | "debug": "^4.3.2", |
| 1162 | 1288 | "escape-string-regexp": "^4.0.0", |
| 1163 | − "eslint-scope": "^8.4.0", | |
| 1164 | − "eslint-visitor-keys": "^4.2.1", | |
| 1165 | − "espree": "^10.4.0", | |
| 1166 | − "esquery": "^1.5.0", | |
| 1289 | + "eslint-scope": "^9.1.1", | |
| 1290 | + "eslint-visitor-keys": "^5.0.1", | |
| 1291 | + "espree": "^11.1.1", | |
| 1292 | + "esquery": "^1.7.0", | |
| 1167 | 1293 | "esutils": "^2.0.2", |
| 1168 | 1294 | "fast-deep-equal": "^3.1.3", |
| 1169 | 1295 | "file-entry-cache": "^8.0.0", |
@@ -1173,8 +1299,7 @@
| 1173 | 1299 | "imurmurhash": "^0.1.4", |
| 1174 | 1300 | "is-glob": "^4.0.0", |
| 1175 | 1301 | "json-stable-stringify-without-jsonify": "^1.0.1", |
| 1176 | − "lodash.merge": "^4.6.2", | |
| 1177 | − "minimatch": "^3.1.2", | |
| 1302 | + "minimatch": "^10.2.1", | |
| 1178 | 1303 | "natural-compare": "^1.4.0", |
| 1179 | 1304 | "optionator": "^0.9.3" |
| 1180 | 1305 | }, |
@@ -1182,7 +1307,7 @@
| 1182 | 1307 | "eslint": "bin/eslint.js" |
| 1183 | 1308 | }, |
| 1184 | 1309 | "engines": { |
| 1185 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 1310 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 1186 | 1311 | }, |
| 1187 | 1312 | "funding": { |
| 1188 | 1313 | "url": "https://eslint.org/donate" |
@@ -1236,83 +1361,61 @@
| 1236 | 1361 | } |
| 1237 | 1362 | }, |
| 1238 | 1363 | "node_modules/eslint-scope": { |
| 1239 | − "version": "8.4.0", | |
| 1240 | − "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", | |
| 1241 | − "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", | |
| 1364 | + "version": "9.1.1", | |
| 1365 | + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.1.tgz", | |
| 1366 | + "integrity": "sha512-GaUN0sWim5qc8KVErfPBWmc31LEsOkrUJbvJZV+xuL3u2phMUK4HIvXlWAakfC8W4nzlK+chPEAkYOYb5ZScIw==", | |
| 1242 | 1367 | "dev": true, |
| 1243 | 1368 | "license": "BSD-2-Clause", |
| 1244 | 1369 | "dependencies": { |
| 1370 | + "@types/esrecurse": "^4.3.1", | |
| 1371 | + "@types/estree": "^1.0.8", | |
| 1245 | 1372 | "esrecurse": "^4.3.0", |
| 1246 | 1373 | "estraverse": "^5.2.0" |
| 1247 | 1374 | }, |
| 1248 | 1375 | "engines": { |
| 1249 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 1376 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 1250 | 1377 | }, |
| 1251 | 1378 | "funding": { |
| 1252 | 1379 | "url": "https://opencollective.com/eslint" |
| 1253 | 1380 | } |
| 1254 | 1381 | }, |
| 1255 | 1382 | "node_modules/eslint-visitor-keys": { |
| 1256 | − "version": "3.4.3", | |
| 1257 | − "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", | |
| 1258 | − "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", | |
| 1259 | − "dev": true, | |
| 1260 | − "engines": { | |
| 1261 | − "node": "^12.22.0 || ^14.17.0 || >=16.0.0" | |
| 1262 | − }, | |
| 1263 | − "funding": { | |
| 1264 | − "url": "https://opencollective.com/eslint" | |
| 1265 | − } | |
| 1266 | − }, | |
| 1267 | − "node_modules/eslint/node_modules/eslint-visitor-keys": { | |
| 1268 | − "version": "4.2.1", | |
| 1269 | − "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", | |
| 1270 | − "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", | |
| 1383 | + "version": "5.0.1", | |
| 1384 | + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", | |
| 1385 | + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", | |
| 1271 | 1386 | "dev": true, |
| 1272 | 1387 | "license": "Apache-2.0", |
| 1273 | 1388 | "engines": { |
| 1274 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 1389 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 1275 | 1390 | }, |
| 1276 | 1391 | "funding": { |
| 1277 | 1392 | "url": "https://opencollective.com/eslint" |
| 1278 | 1393 | } |
| 1279 | 1394 | }, |
| 1280 | 1395 | "node_modules/espree": { |
| 1281 | − "version": "10.4.0", | |
| 1282 | − "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", | |
| 1283 | − "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", | |
| 1396 | + "version": "11.1.1", | |
| 1397 | + "resolved": "https://registry.npmjs.org/espree/-/espree-11.1.1.tgz", | |
| 1398 | + "integrity": "sha512-AVHPqQoZYc+RUM4/3Ly5udlZY/U4LS8pIG05jEjWM2lQMU/oaZ7qshzAl2YP1tfNmXfftH3ohurfwNAug+MnsQ==", | |
| 1284 | 1399 | "dev": true, |
| 1285 | 1400 | "license": "BSD-2-Clause", |
| 1286 | 1401 | "dependencies": { |
| 1287 | − "acorn": "^8.15.0", | |
| 1402 | + "acorn": "^8.16.0", | |
| 1288 | 1403 | "acorn-jsx": "^5.3.2", |
| 1289 | − "eslint-visitor-keys": "^4.2.1" | |
| 1290 | − }, | |
| 1291 | − "engines": { | |
| 1292 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 1404 | + "eslint-visitor-keys": "^5.0.1" | |
| 1293 | 1405 | }, |
| 1294 | − "funding": { | |
| 1295 | − "url": "https://opencollective.com/eslint" | |
| 1296 | − } | |
| 1297 | − }, | |
| 1298 | − "node_modules/espree/node_modules/eslint-visitor-keys": { | |
| 1299 | − "version": "4.2.1", | |
| 1300 | − "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", | |
| 1301 | − "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", | |
| 1302 | − "dev": true, | |
| 1303 | − "license": "Apache-2.0", | |
| 1304 | 1406 | "engines": { |
| 1305 | − "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | |
| 1407 | + "node": "^20.19.0 || ^22.13.0 || >=24" | |
| 1306 | 1408 | }, |
| 1307 | 1409 | "funding": { |
| 1308 | 1410 | "url": "https://opencollective.com/eslint" |
| 1309 | 1411 | } |
| 1310 | 1412 | }, |
| 1311 | 1413 | "node_modules/esquery": { |
| 1312 | − "version": "1.5.0", | |
| 1313 | − "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", | |
| 1314 | − "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", | |
| 1414 | + "version": "1.7.0", | |
| 1415 | + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", | |
| 1416 | + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", | |
| 1315 | 1417 | "dev": true, |
| 1418 | + "license": "BSD-3-Clause", | |
| 1316 | 1419 | "dependencies": { |
| 1317 | 1420 | "estraverse": "^5.1.0" |
| 1318 | 1421 | }, |
@@ -1338,6 +1441,7 @@
| 1338 | 1441 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", |
| 1339 | 1442 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", |
| 1340 | 1443 | "dev": true, |
| 1444 | + "license": "BSD-2-Clause", | |
| 1341 | 1445 | "engines": { |
| 1342 | 1446 | "node": ">=4.0" |
| 1343 | 1447 | } |
@@ -1352,6 +1456,16 @@
| 1352 | 1456 | "node": ">=0.10.0" |
| 1353 | 1457 | } |
| 1354 | 1458 | }, |
| 1459 | + "node_modules/events-universal": { | |
| 1460 | + "version": "1.0.1", | |
| 1461 | + "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", | |
| 1462 | + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", | |
| 1463 | + "dev": true, | |
| 1464 | + "license": "Apache-2.0", | |
| 1465 | + "dependencies": { | |
| 1466 | + "bare-events": "^2.7.0" | |
| 1467 | + } | |
| 1468 | + }, | |
| 1355 | 1469 | "node_modules/fast-deep-equal": { |
| 1356 | 1470 | "version": "3.1.3", |
| 1357 | 1471 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", |
@@ -1377,13 +1491,15 @@
| 1377 | 1491 | "version": "2.0.6", |
| 1378 | 1492 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", |
| 1379 | 1493 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", |
| 1380 | − "dev": true | |
| 1494 | + "dev": true, | |
| 1495 | + "license": "MIT" | |
| 1381 | 1496 | }, |
| 1382 | 1497 | "node_modules/fd-slicer": { |
| 1383 | 1498 | "version": "1.1.0", |
| 1384 | 1499 | "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", |
| 1385 | 1500 | "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", |
| 1386 | 1501 | "dev": true, |
| 1502 | + "license": "MIT", | |
| 1387 | 1503 | "dependencies": { |
| 1388 | 1504 | "pend": "~1.2.0" |
| 1389 | 1505 | } |
@@ -1427,12 +1543,22 @@
| 1427 | 1543 | } |
| 1428 | 1544 | }, |
| 1429 | 1545 | "node_modules/file-type": { |
| 1430 | − "version": "5.2.0", | |
| 1431 | − "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", | |
| 1432 | − "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", | |
| 1546 | + "version": "20.5.0", | |
| 1547 | + "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", | |
| 1548 | + "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", | |
| 1433 | 1549 | "dev": true, |
| 1550 | + "license": "MIT", | |
| 1551 | + "dependencies": { | |
| 1552 | + "@tokenizer/inflate": "^0.2.6", | |
| 1553 | + "strtok3": "^10.2.0", | |
| 1554 | + "token-types": "^6.0.0", | |
| 1555 | + "uint8array-extras": "^1.4.0" | |
| 1556 | + }, | |
| 1434 | 1557 | "engines": { |
| 1435 | − "node": ">=4" | |
| 1558 | + "node": ">=18" | |
| 1559 | + }, | |
| 1560 | + "funding": { | |
| 1561 | + "url": "https://github.com/sindresorhus/file-type?sponsor=1" | |
| 1436 | 1562 | } |
| 1437 | 1563 | }, |
| 1438 | 1564 | "node_modules/find-up": { |
@@ -1440,6 +1566,7 @@
| 1440 | 1566 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", |
| 1441 | 1567 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", |
| 1442 | 1568 | "dev": true, |
| 1569 | + "license": "MIT", | |
| 1443 | 1570 | "dependencies": { |
| 1444 | 1571 | "locate-path": "^6.0.0", |
| 1445 | 1572 | "path-exists": "^4.0.0" |
@@ -1466,23 +1593,41 @@
| 1466 | 1593 | } |
| 1467 | 1594 | }, |
| 1468 | 1595 | "node_modules/flatted": { |
| 1469 | − "version": "3.3.3", | |
| 1470 | − "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", | |
| 1471 | − "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", | |
| 1596 | + "version": "3.3.4", | |
| 1597 | + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.4.tgz", | |
| 1598 | + "integrity": "sha512-3+mMldrTAPdta5kjX2G2J7iX4zxtnwpdA8Tr2ZSjkyPSanvbZAcy6flmtnXbEybHrDcU9641lxrMfFuUxVz9vA==", | |
| 1472 | 1599 | "dev": true, |
| 1473 | 1600 | "license": "ISC" |
| 1474 | 1601 | }, |
| 1602 | + "node_modules/for-each": { | |
| 1603 | + "version": "0.3.5", | |
| 1604 | + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", | |
| 1605 | + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", | |
| 1606 | + "dev": true, | |
| 1607 | + "license": "MIT", | |
| 1608 | + "dependencies": { | |
| 1609 | + "is-callable": "^1.2.7" | |
| 1610 | + }, | |
| 1611 | + "engines": { | |
| 1612 | + "node": ">= 0.4" | |
| 1613 | + }, | |
| 1614 | + "funding": { | |
| 1615 | + "url": "https://github.com/sponsors/ljharb" | |
| 1616 | + } | |
| 1617 | + }, | |
| 1475 | 1618 | "node_modules/fs-constants": { |
| 1476 | 1619 | "version": "1.0.0", |
| 1477 | 1620 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", |
| 1478 | 1621 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", |
| 1479 | − "dev": true | |
| 1622 | + "dev": true, | |
| 1623 | + "license": "MIT" | |
| 1480 | 1624 | }, |
| 1481 | 1625 | "node_modules/function-bind": { |
| 1482 | 1626 | "version": "1.1.2", |
| 1483 | 1627 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", |
| 1484 | 1628 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", |
| 1485 | 1629 | "dev": true, |
| 1630 | + "license": "MIT", | |
| 1486 | 1631 | "funding": { |
| 1487 | 1632 | "url": "https://github.com/sponsors/ljharb" |
| 1488 | 1633 | } |
@@ -1501,31 +1646,55 @@
| 1501 | 1646 | } |
| 1502 | 1647 | }, |
| 1503 | 1648 | "node_modules/get-intrinsic": { |
| 1504 | − "version": "1.2.2", | |
| 1505 | − "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", | |
| 1506 | − "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", | |
| 1649 | + "version": "1.3.0", | |
| 1650 | + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", | |
| 1651 | + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", | |
| 1507 | 1652 | "dev": true, |
| 1653 | + "license": "MIT", | |
| 1508 | 1654 | "dependencies": { |
| 1655 | + "call-bind-apply-helpers": "^1.0.2", | |
| 1656 | + "es-define-property": "^1.0.1", | |
| 1657 | + "es-errors": "^1.3.0", | |
| 1658 | + "es-object-atoms": "^1.1.1", | |
| 1509 | 1659 | "function-bind": "^1.1.2", |
| 1510 | − "has-proto": "^1.0.1", | |
| 1511 | − "has-symbols": "^1.0.3", | |
| 1512 | − "hasown": "^2.0.0" | |
| 1660 | + "get-proto": "^1.0.1", | |
| 1661 | + "gopd": "^1.2.0", | |
| 1662 | + "has-symbols": "^1.1.0", | |
| 1663 | + "hasown": "^2.0.2", | |
| 1664 | + "math-intrinsics": "^1.1.0" | |
| 1665 | + }, | |
| 1666 | + "engines": { | |
| 1667 | + "node": ">= 0.4" | |
| 1513 | 1668 | }, |
| 1514 | 1669 | "funding": { |
| 1515 | 1670 | "url": "https://github.com/sponsors/ljharb" |
| 1516 | 1671 | } |
| 1517 | 1672 | }, |
| 1518 | − "node_modules/get-stream": { | |
| 1519 | − "version": "2.3.1", | |
| 1520 | − "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", | |
| 1521 | − "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", | |
| 1673 | + "node_modules/get-proto": { | |
| 1674 | + "version": "1.0.1", | |
| 1675 | + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", | |
| 1676 | + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", | |
| 1522 | 1677 | "dev": true, |
| 1678 | + "license": "MIT", | |
| 1523 | 1679 | "dependencies": { |
| 1524 | − "object-assign": "^4.0.1", | |
| 1525 | − "pinkie-promise": "^2.0.0" | |
| 1680 | + "dunder-proto": "^1.0.1", | |
| 1681 | + "es-object-atoms": "^1.0.0" | |
| 1526 | 1682 | }, |
| 1527 | 1683 | "engines": { |
| 1528 | − "node": ">=0.10.0" | |
| 1684 | + "node": ">= 0.4" | |
| 1685 | + } | |
| 1686 | + }, | |
| 1687 | + "node_modules/get-stream": { | |
| 1688 | + "version": "6.0.1", | |
| 1689 | + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", | |
| 1690 | + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", | |
| 1691 | + "dev": true, | |
| 1692 | + "license": "MIT", | |
| 1693 | + "engines": { | |
| 1694 | + "node": ">=10" | |
| 1695 | + }, | |
| 1696 | + "funding": { | |
| 1697 | + "url": "https://github.com/sponsors/sindresorhus" | |
| 1529 | 1698 | } |
| 1530 | 1699 | }, |
| 1531 | 1700 | "node_modules/glob-parent": { |
@@ -1533,6 +1702,7 @@
| 1533 | 1702 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", |
| 1534 | 1703 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", |
| 1535 | 1704 | "dev": true, |
| 1705 | + "license": "ISC", | |
| 1536 | 1706 | "dependencies": { |
| 1537 | 1707 | "is-glob": "^4.0.3" |
| 1538 | 1708 | }, |
@@ -1545,6 +1715,7 @@
| 1545 | 1715 | "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", |
| 1546 | 1716 | "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", |
| 1547 | 1717 | "dev": true, |
| 1718 | + "license": "BSD-3-Clause", | |
| 1548 | 1719 | "dependencies": { |
| 1549 | 1720 | "boolean": "^3.0.1", |
| 1550 | 1721 | "es6-error": "^4.1.1", |
@@ -1571,12 +1742,14 @@
| 1571 | 1742 | } |
| 1572 | 1743 | }, |
| 1573 | 1744 | "node_modules/globalthis": { |
| 1574 | − "version": "1.0.3", | |
| 1575 | − "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", | |
| 1576 | − "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", | |
| 1745 | + "version": "1.0.4", | |
| 1746 | + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", | |
| 1747 | + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", | |
| 1577 | 1748 | "dev": true, |
| 1749 | + "license": "MIT", | |
| 1578 | 1750 | "dependencies": { |
| 1579 | − "define-properties": "^1.1.3" | |
| 1751 | + "define-properties": "^1.2.1", | |
| 1752 | + "gopd": "^1.0.1" | |
| 1580 | 1753 | }, |
| 1581 | 1754 | "engines": { |
| 1582 | 1755 | "node": ">= 0.4" |
@@ -1586,12 +1759,13 @@
| 1586 | 1759 | } |
| 1587 | 1760 | }, |
| 1588 | 1761 | "node_modules/gopd": { |
| 1589 | − "version": "1.0.1", | |
| 1590 | − "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", | |
| 1591 | − "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", | |
| 1762 | + "version": "1.2.0", | |
| 1763 | + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", | |
| 1764 | + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", | |
| 1592 | 1765 | "dev": true, |
| 1593 | − "dependencies": { | |
| 1594 | − "get-intrinsic": "^1.1.3" | |
| 1766 | + "license": "MIT", | |
| 1767 | + "engines": { | |
| 1768 | + "node": ">= 0.4" | |
| 1595 | 1769 | }, |
| 1596 | 1770 | "funding": { |
| 1597 | 1771 | "url": "https://github.com/sponsors/ljharb" |
@@ -1601,34 +1775,28 @@
| 1601 | 1775 | "version": "4.2.11", |
| 1602 | 1776 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", |
| 1603 | 1777 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", |
| 1604 | − "dev": true | |
| 1605 | − }, | |
| 1606 | − "node_modules/has-flag": { | |
| 1607 | − "version": "4.0.0", | |
| 1608 | − "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", | |
| 1609 | − "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", | |
| 1610 | 1778 | "dev": true, |
| 1611 | − "engines": { | |
| 1612 | − "node": ">=8" | |
| 1613 | − } | |
| 1779 | + "license": "ISC" | |
| 1614 | 1780 | }, |
| 1615 | 1781 | "node_modules/has-property-descriptors": { |
| 1616 | − "version": "1.0.1", | |
| 1617 | − "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", | |
| 1618 | − "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", | |
| 1782 | + "version": "1.0.2", | |
| 1783 | + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", | |
| 1784 | + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", | |
| 1619 | 1785 | "dev": true, |
| 1786 | + "license": "MIT", | |
| 1620 | 1787 | "dependencies": { |
| 1621 | − "get-intrinsic": "^1.2.2" | |
| 1788 | + "es-define-property": "^1.0.0" | |
| 1622 | 1789 | }, |
| 1623 | 1790 | "funding": { |
| 1624 | 1791 | "url": "https://github.com/sponsors/ljharb" |
| 1625 | 1792 | } |
| 1626 | 1793 | }, |
| 1627 | − "node_modules/has-proto": { | |
| 1628 | − "version": "1.0.1", | |
| 1629 | − "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", | |
| 1630 | − "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", | |
| 1794 | + "node_modules/has-symbols": { | |
| 1795 | + "version": "1.1.0", | |
| 1796 | + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", | |
| 1797 | + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", | |
| 1631 | 1798 | "dev": true, |
| 1799 | + "license": "MIT", | |
| 1632 | 1800 | "engines": { |
| 1633 | 1801 | "node": ">= 0.4" |
| 1634 | 1802 | }, |
@@ -1636,11 +1804,15 @@
| 1636 | 1804 | "url": "https://github.com/sponsors/ljharb" |
| 1637 | 1805 | } |
| 1638 | 1806 | }, |
| 1639 | − "node_modules/has-symbols": { | |
| 1640 | − "version": "1.0.3", | |
| 1641 | − "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", | |
| 1642 | − "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", | |
| 1807 | + "node_modules/has-tostringtag": { | |
| 1808 | + "version": "1.0.2", | |
| 1809 | + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", | |
| 1810 | + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", | |
| 1643 | 1811 | "dev": true, |
| 1812 | + "license": "MIT", | |
| 1813 | + "dependencies": { | |
| 1814 | + "has-symbols": "^1.0.3" | |
| 1815 | + }, | |
| 1644 | 1816 | "engines": { |
| 1645 | 1817 | "node": ">= 0.4" |
| 1646 | 1818 | }, |
@@ -1649,10 +1821,11 @@
| 1649 | 1821 | } |
| 1650 | 1822 | }, |
| 1651 | 1823 | "node_modules/hasown": { |
| 1652 | − "version": "2.0.0", | |
| 1653 | − "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", | |
| 1654 | − "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", | |
| 1824 | + "version": "2.0.2", | |
| 1825 | + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", | |
| 1826 | + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", | |
| 1655 | 1827 | "dev": true, |
| 1828 | + "license": "MIT", | |
| 1656 | 1829 | "dependencies": { |
| 1657 | 1830 | "function-bind": "^1.1.2" |
| 1658 | 1831 | }, |
@@ -1678,32 +1851,17 @@
| 1678 | 1851 | "type": "consulting", |
| 1679 | 1852 | "url": "https://feross.org/support" |
| 1680 | 1853 | } |
| 1681 | − ] | |
| 1854 | + ], | |
| 1855 | + "license": "BSD-3-Clause" | |
| 1682 | 1856 | }, |
| 1683 | 1857 | "node_modules/ignore": { |
| 1684 | − "version": "5.3.0", | |
| 1685 | − "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", | |
| 1686 | − "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", | |
| 1687 | − "dev": true, | |
| 1688 | − "engines": { | |
| 1689 | − "node": ">= 4" | |
| 1690 | − } | |
| 1691 | − }, | |
| 1692 | − "node_modules/import-fresh": { | |
| 1693 | − "version": "3.3.1", | |
| 1694 | − "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", | |
| 1695 | − "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", | |
| 1858 | + "version": "5.3.2", | |
| 1859 | + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", | |
| 1860 | + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", | |
| 1696 | 1861 | "dev": true, |
| 1697 | 1862 | "license": "MIT", |
| 1698 | − "dependencies": { | |
| 1699 | − "parent-module": "^1.0.0", | |
| 1700 | − "resolve-from": "^4.0.0" | |
| 1701 | − }, | |
| 1702 | 1863 | "engines": { |
| 1703 | − "node": ">=6" | |
| 1704 | − }, | |
| 1705 | − "funding": { | |
| 1706 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 1864 | + "node": ">= 4" | |
| 1707 | 1865 | } |
| 1708 | 1866 | }, |
| 1709 | 1867 | "node_modules/imurmurhash": { |
@@ -1711,6 +1869,7 @@
| 1711 | 1869 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", |
| 1712 | 1870 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", |
| 1713 | 1871 | "dev": true, |
| 1872 | + "license": "MIT", | |
| 1714 | 1873 | "engines": { |
| 1715 | 1874 | "node": ">=0.8.19" |
| 1716 | 1875 | } |
@@ -1719,7 +1878,8 @@
| 1719 | 1878 | "version": "2.0.4", |
| 1720 | 1879 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", |
| 1721 | 1880 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", |
| 1722 | − "dev": true | |
| 1881 | + "dev": true, | |
| 1882 | + "license": "ISC" | |
| 1723 | 1883 | }, |
| 1724 | 1884 | "node_modules/ini": { |
| 1725 | 1885 | "version": "4.1.3", |
@@ -1757,6 +1917,19 @@
| 1757 | 1917 | "url": "https://github.com/sponsors/wooorm" |
| 1758 | 1918 | } |
| 1759 | 1919 | }, |
| 1920 | + "node_modules/is-callable": { | |
| 1921 | + "version": "1.2.7", | |
| 1922 | + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", | |
| 1923 | + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", | |
| 1924 | + "dev": true, | |
| 1925 | + "license": "MIT", | |
| 1926 | + "engines": { | |
| 1927 | + "node": ">= 0.4" | |
| 1928 | + }, | |
| 1929 | + "funding": { | |
| 1930 | + "url": "https://github.com/sponsors/ljharb" | |
| 1931 | + } | |
| 1932 | + }, | |
| 1760 | 1933 | "node_modules/is-decimal": { |
| 1761 | 1934 | "version": "2.0.1", |
| 1762 | 1935 | "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", |
@@ -1773,6 +1946,7 @@
| 1773 | 1946 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", |
| 1774 | 1947 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", |
| 1775 | 1948 | "dev": true, |
| 1949 | + "license": "MIT", | |
| 1776 | 1950 | "engines": { |
| 1777 | 1951 | "node": ">=0.10.0" |
| 1778 | 1952 | } |
@@ -1782,6 +1956,7 @@
| 1782 | 1956 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", |
| 1783 | 1957 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", |
| 1784 | 1958 | "dev": true, |
| 1959 | + "license": "MIT", | |
| 1785 | 1960 | "dependencies": { |
| 1786 | 1961 | "is-extglob": "^2.1.1" |
| 1787 | 1962 | }, |
@@ -1804,28 +1979,51 @@
| 1804 | 1979 | "version": "4.0.1", |
| 1805 | 1980 | "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", |
| 1806 | 1981 | "integrity": "sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ==", |
| 1807 | − "dev": true | |
| 1982 | + "dev": true, | |
| 1983 | + "license": "MIT" | |
| 1808 | 1984 | }, |
| 1809 | 1985 | "node_modules/is-stream": { |
| 1810 | − "version": "1.1.0", | |
| 1811 | − "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", | |
| 1812 | − "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", | |
| 1986 | + "version": "2.0.1", | |
| 1987 | + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", | |
| 1988 | + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", | |
| 1989 | + "dev": true, | |
| 1990 | + "license": "MIT", | |
| 1991 | + "engines": { | |
| 1992 | + "node": ">=8" | |
| 1993 | + }, | |
| 1994 | + "funding": { | |
| 1995 | + "url": "https://github.com/sponsors/sindresorhus" | |
| 1996 | + } | |
| 1997 | + }, | |
| 1998 | + "node_modules/is-typed-array": { | |
| 1999 | + "version": "1.1.15", | |
| 2000 | + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", | |
| 2001 | + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", | |
| 1813 | 2002 | "dev": true, |
| 2003 | + "license": "MIT", | |
| 2004 | + "dependencies": { | |
| 2005 | + "which-typed-array": "^1.1.16" | |
| 2006 | + }, | |
| 1814 | 2007 | "engines": { |
| 1815 | − "node": ">=0.10.0" | |
| 2008 | + "node": ">= 0.4" | |
| 2009 | + }, | |
| 2010 | + "funding": { | |
| 2011 | + "url": "https://github.com/sponsors/ljharb" | |
| 1816 | 2012 | } |
| 1817 | 2013 | }, |
| 1818 | 2014 | "node_modules/isarray": { |
| 1819 | 2015 | "version": "1.0.0", |
| 1820 | 2016 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", |
| 1821 | 2017 | "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", |
| 1822 | − "dev": true | |
| 2018 | + "dev": true, | |
| 2019 | + "license": "MIT" | |
| 1823 | 2020 | }, |
| 1824 | 2021 | "node_modules/isexe": { |
| 1825 | 2022 | "version": "2.0.0", |
| 1826 | 2023 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", |
| 1827 | 2024 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", |
| 1828 | − "dev": true | |
| 2025 | + "dev": true, | |
| 2026 | + "license": "ISC" | |
| 1829 | 2027 | }, |
| 1830 | 2028 | "node_modules/js-yaml": { |
| 1831 | 2029 | "version": "4.1.1", |
@@ -1858,13 +2056,15 @@
| 1858 | 2056 | "version": "1.0.1", |
| 1859 | 2057 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", |
| 1860 | 2058 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", |
| 1861 | − "dev": true | |
| 2059 | + "dev": true, | |
| 2060 | + "license": "MIT" | |
| 1862 | 2061 | }, |
| 1863 | 2062 | "node_modules/json-stringify-safe": { |
| 1864 | 2063 | "version": "5.0.1", |
| 1865 | 2064 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", |
| 1866 | 2065 | "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", |
| 1867 | − "dev": true | |
| 2066 | + "dev": true, | |
| 2067 | + "license": "ISC" | |
| 1868 | 2068 | }, |
| 1869 | 2069 | "node_modules/jsonc-parser": { |
| 1870 | 2070 | "version": "3.3.1", |
@@ -1925,6 +2125,7 @@
| 1925 | 2125 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", |
| 1926 | 2126 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", |
| 1927 | 2127 | "dev": true, |
| 2128 | + "license": "MIT", | |
| 1928 | 2129 | "dependencies": { |
| 1929 | 2130 | "prelude-ls": "^1.2.1", |
| 1930 | 2131 | "type-check": "~0.4.0" |
@@ -1948,6 +2149,7 @@
| 1948 | 2149 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", |
| 1949 | 2150 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", |
| 1950 | 2151 | "dev": true, |
| 2152 | + "license": "MIT", | |
| 1951 | 2153 | "dependencies": { |
| 1952 | 2154 | "p-locate": "^5.0.0" |
| 1953 | 2155 | }, |
@@ -1964,17 +2166,12 @@
| 1964 | 2166 | "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", |
| 1965 | 2167 | "license": "MIT" |
| 1966 | 2168 | }, |
| 1967 | − "node_modules/lodash.merge": { | |
| 1968 | − "version": "4.6.2", | |
| 1969 | − "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", | |
| 1970 | − "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", | |
| 1971 | − "dev": true | |
| 1972 | − }, | |
| 1973 | 2169 | "node_modules/make-dir": { |
| 1974 | 2170 | "version": "1.3.0", |
| 1975 | 2171 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", |
| 1976 | 2172 | "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", |
| 1977 | 2173 | "dev": true, |
| 2174 | + "license": "MIT", | |
| 1978 | 2175 | "dependencies": { |
| 1979 | 2176 | "pify": "^3.0.0" |
| 1980 | 2177 | }, |
@@ -1987,6 +2184,7 @@
| 1987 | 2184 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", |
| 1988 | 2185 | "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", |
| 1989 | 2186 | "dev": true, |
| 2187 | + "license": "MIT", | |
| 1990 | 2188 | "engines": { |
| 1991 | 2189 | "node": ">=4" |
| 1992 | 2190 | } |
@@ -2060,29 +2258,6 @@
| 2060 | 2258 | "node": ">=20" |
| 2061 | 2259 | } |
| 2062 | 2260 | }, |
| 2063 | − "node_modules/markdownlint-cli/node_modules/balanced-match": { | |
| 2064 | − "version": "4.0.4", | |
| 2065 | − "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", | |
| 2066 | − "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", | |
| 2067 | − "dev": true, | |
| 2068 | − "license": "MIT", | |
| 2069 | − "engines": { | |
| 2070 | − "node": "18 || 20 || >=22" | |
| 2071 | − } | |
| 2072 | − }, | |
| 2073 | − "node_modules/markdownlint-cli/node_modules/brace-expansion": { | |
| 2074 | − "version": "5.0.4", | |
| 2075 | − "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", | |
| 2076 | − "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", | |
| 2077 | − "dev": true, | |
| 2078 | − "license": "MIT", | |
| 2079 | − "dependencies": { | |
| 2080 | − "balanced-match": "^4.0.2" | |
| 2081 | − }, | |
| 2082 | − "engines": { | |
| 2083 | − "node": "18 || 20 || >=22" | |
| 2084 | − } | |
| 2085 | − }, | |
| 2086 | 2261 | "node_modules/markdownlint-cli/node_modules/ignore": { |
| 2087 | 2262 | "version": "7.0.5", |
| 2088 | 2263 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", |
@@ -2114,6 +2289,7 @@
| 2114 | 2289 | "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", |
| 2115 | 2290 | "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", |
| 2116 | 2291 | "dev": true, |
| 2292 | + "license": "MIT", | |
| 2117 | 2293 | "dependencies": { |
| 2118 | 2294 | "escape-string-regexp": "^4.0.0" |
| 2119 | 2295 | }, |
@@ -2121,6 +2297,16 @@
| 2121 | 2297 | "node": ">=10" |
| 2122 | 2298 | } |
| 2123 | 2299 | }, |
| 2300 | + "node_modules/math-intrinsics": { | |
| 2301 | + "version": "1.1.0", | |
| 2302 | + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", | |
| 2303 | + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", | |
| 2304 | + "dev": true, | |
| 2305 | + "license": "MIT", | |
| 2306 | + "engines": { | |
| 2307 | + "node": ">= 0.4" | |
| 2308 | + } | |
| 2309 | + }, | |
| 2124 | 2310 | "node_modules/mdurl": { |
| 2125 | 2311 | "version": "2.0.0", |
| 2126 | 2312 | "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", |
@@ -2665,16 +2851,19 @@
| 2665 | 2851 | "license": "MIT" |
| 2666 | 2852 | }, |
| 2667 | 2853 | "node_modules/minimatch": { |
| 2668 | − "version": "3.1.5", | |
| 2669 | − "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", | |
| 2670 | − "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", | |
| 2854 | + "version": "10.2.4", | |
| 2855 | + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", | |
| 2856 | + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", | |
| 2671 | 2857 | "dev": true, |
| 2672 | − "license": "ISC", | |
| 2858 | + "license": "BlueOak-1.0.0", | |
| 2673 | 2859 | "dependencies": { |
| 2674 | − "brace-expansion": "^1.1.7" | |
| 2860 | + "brace-expansion": "^5.0.2" | |
| 2675 | 2861 | }, |
| 2676 | 2862 | "engines": { |
| 2677 | − "node": "*" | |
| 2863 | + "node": "18 || 20 || >=22" | |
| 2864 | + }, | |
| 2865 | + "funding": { | |
| 2866 | + "url": "https://github.com/sponsors/isaacs" | |
| 2678 | 2867 | } |
| 2679 | 2868 | }, |
| 2680 | 2869 | "node_modules/minimist": { |
@@ -2698,13 +2887,15 @@
| 2698 | 2887 | "version": "1.4.0", |
| 2699 | 2888 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", |
| 2700 | 2889 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", |
| 2701 | − "dev": true | |
| 2890 | + "dev": true, | |
| 2891 | + "license": "MIT" | |
| 2702 | 2892 | }, |
| 2703 | 2893 | "node_modules/object-assign": { |
| 2704 | 2894 | "version": "4.1.1", |
| 2705 | 2895 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", |
| 2706 | 2896 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", |
| 2707 | 2897 | "dev": true, |
| 2898 | + "license": "MIT", | |
| 2708 | 2899 | "engines": { |
| 2709 | 2900 | "node": ">=0.10.0" |
| 2710 | 2901 | } |
@@ -2714,6 +2905,7 @@
| 2714 | 2905 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", |
| 2715 | 2906 | "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", |
| 2716 | 2907 | "dev": true, |
| 2908 | + "license": "MIT", | |
| 2717 | 2909 | "engines": { |
| 2718 | 2910 | "node": ">= 0.4" |
| 2719 | 2911 | } |
@@ -2723,22 +2915,24 @@
| 2723 | 2915 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
| 2724 | 2916 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", |
| 2725 | 2917 | "dev": true, |
| 2918 | + "license": "ISC", | |
| 2726 | 2919 | "dependencies": { |
| 2727 | 2920 | "wrappy": "1" |
| 2728 | 2921 | } |
| 2729 | 2922 | }, |
| 2730 | 2923 | "node_modules/optionator": { |
| 2731 | − "version": "0.9.3", | |
| 2732 | − "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", | |
| 2733 | − "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", | |
| 2924 | + "version": "0.9.4", | |
| 2925 | + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", | |
| 2926 | + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", | |
| 2734 | 2927 | "dev": true, |
| 2928 | + "license": "MIT", | |
| 2735 | 2929 | "dependencies": { |
| 2736 | − "@aashutoshrathi/word-wrap": "^1.2.3", | |
| 2737 | 2930 | "deep-is": "^0.1.3", |
| 2738 | 2931 | "fast-levenshtein": "^2.0.6", |
| 2739 | 2932 | "levn": "^0.4.1", |
| 2740 | 2933 | "prelude-ls": "^1.2.1", |
| 2741 | − "type-check": "^0.4.0" | |
| 2934 | + "type-check": "^0.4.0", | |
| 2935 | + "word-wrap": "^1.2.5" | |
| 2742 | 2936 | }, |
| 2743 | 2937 | "engines": { |
| 2744 | 2938 | "node": ">= 0.8.0" |
@@ -2749,6 +2943,7 @@
| 2749 | 2943 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", |
| 2750 | 2944 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", |
| 2751 | 2945 | "dev": true, |
| 2946 | + "license": "MIT", | |
| 2752 | 2947 | "dependencies": { |
| 2753 | 2948 | "yocto-queue": "^0.1.0" |
| 2754 | 2949 | }, |
@@ -2764,6 +2959,7 @@
| 2764 | 2959 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", |
| 2765 | 2960 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", |
| 2766 | 2961 | "dev": true, |
| 2962 | + "license": "MIT", | |
| 2767 | 2963 | "dependencies": { |
| 2768 | 2964 | "p-limit": "^3.0.2" |
| 2769 | 2965 | }, |
@@ -2774,19 +2970,6 @@
| 2774 | 2970 | "url": "https://github.com/sponsors/sindresorhus" |
| 2775 | 2971 | } |
| 2776 | 2972 | }, |
| 2777 | − "node_modules/parent-module": { | |
| 2778 | − "version": "1.0.1", | |
| 2779 | − "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", | |
| 2780 | − "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", | |
| 2781 | − "dev": true, | |
| 2782 | − "license": "MIT", | |
| 2783 | − "dependencies": { | |
| 2784 | − "callsites": "^3.0.0" | |
| 2785 | − }, | |
| 2786 | − "engines": { | |
| 2787 | − "node": ">=6" | |
| 2788 | − } | |
| 2789 | − }, | |
| 2790 | 2973 | "node_modules/parse-entities": { |
| 2791 | 2974 | "version": "4.0.2", |
| 2792 | 2975 | "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", |
@@ -2812,6 +2995,7 @@
| 2812 | 2995 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", |
| 2813 | 2996 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", |
| 2814 | 2997 | "dev": true, |
| 2998 | + "license": "MIT", | |
| 2815 | 2999 | "engines": { |
| 2816 | 3000 | "node": ">=8" |
| 2817 | 3001 | } |
@@ -2821,6 +3005,7 @@
| 2821 | 3005 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", |
| 2822 | 3006 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", |
| 2823 | 3007 | "dev": true, |
| 3008 | + "license": "MIT", | |
| 2824 | 3009 | "engines": { |
| 2825 | 3010 | "node": ">=8" |
| 2826 | 3011 | } |
@@ -2829,7 +3014,8 @@
| 2829 | 3014 | "version": "1.2.0", |
| 2830 | 3015 | "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", |
| 2831 | 3016 | "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", |
| 2832 | − "dev": true | |
| 3017 | + "dev": true, | |
| 3018 | + "license": "MIT" | |
| 2833 | 3019 | }, |
| 2834 | 3020 | "node_modules/picomatch": { |
| 2835 | 3021 | "version": "4.0.3", |
@@ -2849,6 +3035,7 @@
| 2849 | 3035 | "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", |
| 2850 | 3036 | "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", |
| 2851 | 3037 | "dev": true, |
| 3038 | + "license": "MIT", | |
| 2852 | 3039 | "engines": { |
| 2853 | 3040 | "node": ">=0.10.0" |
| 2854 | 3041 | } |
@@ -2858,6 +3045,7 @@
| 2858 | 3045 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", |
| 2859 | 3046 | "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", |
| 2860 | 3047 | "dev": true, |
| 3048 | + "license": "MIT", | |
| 2861 | 3049 | "engines": { |
| 2862 | 3050 | "node": ">=0.10.0" |
| 2863 | 3051 | } |
@@ -2867,6 +3055,7 @@
| 2867 | 3055 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", |
| 2868 | 3056 | "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", |
| 2869 | 3057 | "dev": true, |
| 3058 | + "license": "MIT", | |
| 2870 | 3059 | "dependencies": { |
| 2871 | 3060 | "pinkie": "^2.0.0" |
| 2872 | 3061 | }, |
@@ -2874,11 +3063,22 @@
| 2874 | 3063 | "node": ">=0.10.0" |
| 2875 | 3064 | } |
| 2876 | 3065 | }, |
| 3066 | + "node_modules/possible-typed-array-names": { | |
| 3067 | + "version": "1.1.0", | |
| 3068 | + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", | |
| 3069 | + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", | |
| 3070 | + "dev": true, | |
| 3071 | + "license": "MIT", | |
| 3072 | + "engines": { | |
| 3073 | + "node": ">= 0.4" | |
| 3074 | + } | |
| 3075 | + }, | |
| 2877 | 3076 | "node_modules/prelude-ls": { |
| 2878 | 3077 | "version": "1.2.1", |
| 2879 | 3078 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", |
| 2880 | 3079 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", |
| 2881 | 3080 | "dev": true, |
| 3081 | + "license": "MIT", | |
| 2882 | 3082 | "engines": { |
| 2883 | 3083 | "node": ">= 0.8.0" |
| 2884 | 3084 | } |
@@ -2903,7 +3103,8 @@
| 2903 | 3103 | "version": "2.0.1", |
| 2904 | 3104 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", |
| 2905 | 3105 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", |
| 2906 | − "dev": true | |
| 3106 | + "dev": true, | |
| 3107 | + "license": "MIT" | |
| 2907 | 3108 | }, |
| 2908 | 3109 | "node_modules/punycode": { |
| 2909 | 3110 | "version": "2.3.1", |
@@ -2930,6 +3131,7 @@
| 2930 | 3131 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", |
| 2931 | 3132 | "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", |
| 2932 | 3133 | "dev": true, |
| 3134 | + "license": "MIT", | |
| 2933 | 3135 | "dependencies": { |
| 2934 | 3136 | "core-util-is": "~1.0.0", |
| 2935 | 3137 | "inherits": "~2.0.3", |
@@ -2944,23 +3146,15 @@
| 2944 | 3146 | "version": "5.1.2", |
| 2945 | 3147 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", |
| 2946 | 3148 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", |
| 2947 | − "dev": true | |
| 2948 | − }, | |
| 2949 | − "node_modules/resolve-from": { | |
| 2950 | − "version": "4.0.0", | |
| 2951 | − "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", | |
| 2952 | − "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", | |
| 2953 | 3149 | "dev": true, |
| 2954 | − "license": "MIT", | |
| 2955 | − "engines": { | |
| 2956 | − "node": ">=4" | |
| 2957 | − } | |
| 3150 | + "license": "MIT" | |
| 2958 | 3151 | }, |
| 2959 | 3152 | "node_modules/roarr": { |
| 2960 | 3153 | "version": "2.15.4", |
| 2961 | 3154 | "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", |
| 2962 | 3155 | "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", |
| 2963 | 3156 | "dev": true, |
| 3157 | + "license": "BSD-3-Clause", | |
| 2964 | 3158 | "dependencies": { |
| 2965 | 3159 | "boolean": "^3.0.1", |
| 2966 | 3160 | "detect-node": "^2.0.4", |
@@ -3007,13 +3201,15 @@
| 3007 | 3201 | "type": "consulting", |
| 3008 | 3202 | "url": "https://feross.org/support" |
| 3009 | 3203 | } |
| 3010 | − ] | |
| 3204 | + ], | |
| 3205 | + "license": "MIT" | |
| 3011 | 3206 | }, |
| 3012 | 3207 | "node_modules/seek-bzip": { |
| 3013 | 3208 | "version": "1.0.6", |
| 3014 | 3209 | "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", |
| 3015 | 3210 | "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", |
| 3016 | 3211 | "dev": true, |
| 3212 | + "license": "MIT", | |
| 3017 | 3213 | "dependencies": { |
| 3018 | 3214 | "commander": "^2.8.1" |
| 3019 | 3215 | }, |
@@ -3026,7 +3222,8 @@
| 3026 | 3222 | "version": "2.20.3", |
| 3027 | 3223 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", |
| 3028 | 3224 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", |
| 3029 | − "dev": true | |
| 3225 | + "dev": true, | |
| 3226 | + "license": "MIT" | |
| 3030 | 3227 | }, |
| 3031 | 3228 | "node_modules/semver": { |
| 3032 | 3229 | "version": "7.7.2", |
@@ -3044,13 +3241,15 @@
| 3044 | 3241 | "version": "1.0.0", |
| 3045 | 3242 | "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", |
| 3046 | 3243 | "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", |
| 3047 | − "dev": true | |
| 3244 | + "dev": true, | |
| 3245 | + "license": "MIT" | |
| 3048 | 3246 | }, |
| 3049 | 3247 | "node_modules/serialize-error": { |
| 3050 | 3248 | "version": "7.0.1", |
| 3051 | 3249 | "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", |
| 3052 | 3250 | "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", |
| 3053 | 3251 | "dev": true, |
| 3252 | + "license": "MIT", | |
| 3054 | 3253 | "dependencies": { |
| 3055 | 3254 | "type-fest": "^0.13.1" |
| 3056 | 3255 | }, |
@@ -3061,16 +3260,22 @@
| 3061 | 3260 | "url": "https://github.com/sponsors/sindresorhus" |
| 3062 | 3261 | } |
| 3063 | 3262 | }, |
| 3064 | − "node_modules/serialize-error/node_modules/type-fest": { | |
| 3065 | − "version": "0.13.1", | |
| 3066 | − "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", | |
| 3067 | − "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", | |
| 3263 | + "node_modules/set-function-length": { | |
| 3264 | + "version": "1.2.2", | |
| 3265 | + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", | |
| 3266 | + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", | |
| 3068 | 3267 | "dev": true, |
| 3069 | − "engines": { | |
| 3070 | − "node": ">=10" | |
| 3268 | + "license": "MIT", | |
| 3269 | + "dependencies": { | |
| 3270 | + "define-data-property": "^1.1.4", | |
| 3271 | + "es-errors": "^1.3.0", | |
| 3272 | + "function-bind": "^1.1.2", | |
| 3273 | + "get-intrinsic": "^1.2.4", | |
| 3274 | + "gopd": "^1.0.1", | |
| 3275 | + "has-property-descriptors": "^1.0.2" | |
| 3071 | 3276 | }, |
| 3072 | − "funding": { | |
| 3073 | − "url": "https://github.com/sponsors/sindresorhus" | |
| 3277 | + "engines": { | |
| 3278 | + "node": ">= 0.4" | |
| 3074 | 3279 | } |
| 3075 | 3280 | }, |
| 3076 | 3281 | "node_modules/shebang-command": { |
@@ -3078,6 +3283,7 @@
| 3078 | 3283 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", |
| 3079 | 3284 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", |
| 3080 | 3285 | "dev": true, |
| 3286 | + "license": "MIT", | |
| 3081 | 3287 | "dependencies": { |
| 3082 | 3288 | "shebang-regex": "^3.0.0" |
| 3083 | 3289 | }, |
@@ -3090,6 +3296,7 @@
| 3090 | 3296 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", |
| 3091 | 3297 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", |
| 3092 | 3298 | "dev": true, |
| 3299 | + "license": "MIT", | |
| 3093 | 3300 | "engines": { |
| 3094 | 3301 | "node": ">=8" |
| 3095 | 3302 | } |
@@ -3131,20 +3338,19 @@
| 3131 | 3338 | "version": "1.1.3", |
| 3132 | 3339 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", |
| 3133 | 3340 | "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", |
| 3134 | − "dev": true | |
| 3341 | + "dev": true, | |
| 3342 | + "license": "BSD-3-Clause" | |
| 3135 | 3343 | }, |
| 3136 | 3344 | "node_modules/streamx": { |
| 3137 | − "version": "2.22.1", | |
| 3138 | − "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.1.tgz", | |
| 3139 | − "integrity": "sha512-znKXEBxfatz2GBNK02kRnCXjV+AA4kjZIUxeWSr3UGirZMJfTE9uiwKHobnbgxWyL/JWro8tTq+vOqAK1/qbSA==", | |
| 3345 | + "version": "2.23.0", | |
| 3346 | + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", | |
| 3347 | + "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==", | |
| 3140 | 3348 | "dev": true, |
| 3141 | 3349 | "license": "MIT", |
| 3142 | 3350 | "dependencies": { |
| 3351 | + "events-universal": "^1.0.0", | |
| 3143 | 3352 | "fast-fifo": "^1.3.2", |
| 3144 | 3353 | "text-decoder": "^1.1.0" |
| 3145 | − }, | |
| 3146 | − "optionalDependencies": { | |
| 3147 | − "bare-events": "^2.2.0" | |
| 3148 | 3354 | } |
| 3149 | 3355 | }, |
| 3150 | 3356 | "node_modules/string_decoder": { |
@@ -3152,6 +3358,7 @@
| 3152 | 3358 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", |
| 3153 | 3359 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", |
| 3154 | 3360 | "dev": true, |
| 3361 | + "license": "MIT", | |
| 3155 | 3362 | "dependencies": { |
| 3156 | 3363 | "safe-buffer": "~5.1.0" |
| 3157 | 3364 | } |
@@ -3160,7 +3367,8 @@
| 3160 | 3367 | "version": "5.1.2", |
| 3161 | 3368 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", |
| 3162 | 3369 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", |
| 3163 | − "dev": true | |
| 3370 | + "dev": true, | |
| 3371 | + "license": "MIT" | |
| 3164 | 3372 | }, |
| 3165 | 3373 | "node_modules/string-width": { |
| 3166 | 3374 | "version": "8.1.0", |
@@ -3200,6 +3408,7 @@
| 3200 | 3408 | "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", |
| 3201 | 3409 | "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", |
| 3202 | 3410 | "dev": true, |
| 3411 | + "license": "MIT", | |
| 3203 | 3412 | "dependencies": { |
| 3204 | 3413 | "is-natural-number": "^4.0.1" |
| 3205 | 3414 | } |
@@ -3234,40 +3443,33 @@
| 3234 | 3443 | "url": "https://github.com/sponsors/Borewit" |
| 3235 | 3444 | } |
| 3236 | 3445 | }, |
| 3237 | − "node_modules/supports-color": { | |
| 3238 | − "version": "7.2.0", | |
| 3239 | − "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", | |
| 3240 | − "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", | |
| 3446 | + "node_modules/tar-stream": { | |
| 3447 | + "version": "3.1.8", | |
| 3448 | + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.8.tgz", | |
| 3449 | + "integrity": "sha512-U6QpVRyCGHva435KoNWy9PRoi2IFYCgtEhq9nmrPPpbRacPs9IH4aJ3gbrFC8dPcXvdSZ4XXfXT5Fshbp2MtlQ==", | |
| 3241 | 3450 | "dev": true, |
| 3451 | + "license": "MIT", | |
| 3242 | 3452 | "dependencies": { |
| 3243 | − "has-flag": "^4.0.0" | |
| 3244 | − }, | |
| 3245 | − "engines": { | |
| 3246 | − "node": ">=8" | |
| 3453 | + "b4a": "^1.6.4", | |
| 3454 | + "bare-fs": "^4.5.5", | |
| 3455 | + "fast-fifo": "^1.2.0", | |
| 3456 | + "streamx": "^2.15.0" | |
| 3247 | 3457 | } |
| 3248 | 3458 | }, |
| 3249 | − "node_modules/tar-stream": { | |
| 3250 | − "version": "1.6.2", | |
| 3251 | − "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", | |
| 3252 | − "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", | |
| 3459 | + "node_modules/teex": { | |
| 3460 | + "version": "1.0.1", | |
| 3461 | + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", | |
| 3462 | + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", | |
| 3253 | 3463 | "dev": true, |
| 3464 | + "license": "MIT", | |
| 3254 | 3465 | "dependencies": { |
| 3255 | − "bl": "^1.0.0", | |
| 3256 | − "buffer-alloc": "^1.2.0", | |
| 3257 | − "end-of-stream": "^1.0.0", | |
| 3258 | − "fs-constants": "^1.0.0", | |
| 3259 | − "readable-stream": "^2.3.0", | |
| 3260 | − "to-buffer": "^1.1.1", | |
| 3261 | − "xtend": "^4.0.0" | |
| 3262 | − }, | |
| 3263 | − "engines": { | |
| 3264 | − "node": ">= 0.8.0" | |
| 3466 | + "streamx": "^2.12.5" | |
| 3265 | 3467 | } |
| 3266 | 3468 | }, |
| 3267 | 3469 | "node_modules/text-decoder": { |
| 3268 | − "version": "1.2.3", | |
| 3269 | − "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", | |
| 3270 | − "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", | |
| 3470 | + "version": "1.2.7", | |
| 3471 | + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz", | |
| 3472 | + "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==", | |
| 3271 | 3473 | "dev": true, |
| 3272 | 3474 | "license": "Apache-2.0", |
| 3273 | 3475 | "dependencies": { |
@@ -3278,7 +3480,8 @@
| 3278 | 3480 | "version": "2.3.8", |
| 3279 | 3481 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", |
| 3280 | 3482 | "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", |
| 3281 | − "dev": true | |
| 3483 | + "dev": true, | |
| 3484 | + "license": "MIT" | |
| 3282 | 3485 | }, |
| 3283 | 3486 | "node_modules/tinyglobby": { |
| 3284 | 3487 | "version": "0.2.15", |
@@ -3298,19 +3501,35 @@
| 3298 | 3501 | } |
| 3299 | 3502 | }, |
| 3300 | 3503 | "node_modules/to-buffer": { |
| 3301 | − "version": "1.1.1", | |
| 3302 | − "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", | |
| 3303 | − "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", | |
| 3304 | − "dev": true | |
| 3504 | + "version": "1.2.2", | |
| 3505 | + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", | |
| 3506 | + "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==", | |
| 3507 | + "dev": true, | |
| 3508 | + "license": "MIT", | |
| 3509 | + "dependencies": { | |
| 3510 | + "isarray": "^2.0.5", | |
| 3511 | + "safe-buffer": "^5.2.1", | |
| 3512 | + "typed-array-buffer": "^1.0.3" | |
| 3513 | + }, | |
| 3514 | + "engines": { | |
| 3515 | + "node": ">= 0.4" | |
| 3516 | + } | |
| 3517 | + }, | |
| 3518 | + "node_modules/to-buffer/node_modules/isarray": { | |
| 3519 | + "version": "2.0.5", | |
| 3520 | + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", | |
| 3521 | + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", | |
| 3522 | + "dev": true, | |
| 3523 | + "license": "MIT" | |
| 3305 | 3524 | }, |
| 3306 | 3525 | "node_modules/token-types": { |
| 3307 | − "version": "6.1.1", | |
| 3308 | − "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", | |
| 3309 | − "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", | |
| 3526 | + "version": "6.1.2", | |
| 3527 | + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz", | |
| 3528 | + "integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==", | |
| 3310 | 3529 | "dev": true, |
| 3311 | 3530 | "license": "MIT", |
| 3312 | 3531 | "dependencies": { |
| 3313 | − "@borewit/text-codec": "^0.1.0", | |
| 3532 | + "@borewit/text-codec": "^0.2.1", | |
| 3314 | 3533 | "@tokenizer/token": "^0.3.0", |
| 3315 | 3534 | "ieee754": "^1.2.1" |
| 3316 | 3535 | }, |
@@ -3333,6 +3552,7 @@
| 3333 | 3552 | "version": "0.0.6", |
| 3334 | 3553 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", |
| 3335 | 3554 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", |
| 3555 | + "license": "MIT", | |
| 3336 | 3556 | "engines": { |
| 3337 | 3557 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" |
| 3338 | 3558 | } |
@@ -3342,6 +3562,7 @@
| 3342 | 3562 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", |
| 3343 | 3563 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", |
| 3344 | 3564 | "dev": true, |
| 3565 | + "license": "MIT", | |
| 3345 | 3566 | "dependencies": { |
| 3346 | 3567 | "prelude-ls": "^1.2.1" |
| 3347 | 3568 | }, |
@@ -3349,6 +3570,34 @@
| 3349 | 3570 | "node": ">= 0.8.0" |
| 3350 | 3571 | } |
| 3351 | 3572 | }, |
| 3573 | + "node_modules/type-fest": { | |
| 3574 | + "version": "0.13.1", | |
| 3575 | + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", | |
| 3576 | + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", | |
| 3577 | + "dev": true, | |
| 3578 | + "license": "(MIT OR CC0-1.0)", | |
| 3579 | + "engines": { | |
| 3580 | + "node": ">=10" | |
| 3581 | + }, | |
| 3582 | + "funding": { | |
| 3583 | + "url": "https://github.com/sponsors/sindresorhus" | |
| 3584 | + } | |
| 3585 | + }, | |
| 3586 | + "node_modules/typed-array-buffer": { | |
| 3587 | + "version": "1.0.3", | |
| 3588 | + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", | |
| 3589 | + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", | |
| 3590 | + "dev": true, | |
| 3591 | + "license": "MIT", | |
| 3592 | + "dependencies": { | |
| 3593 | + "call-bound": "^1.0.3", | |
| 3594 | + "es-errors": "^1.3.0", | |
| 3595 | + "is-typed-array": "^1.1.14" | |
| 3596 | + }, | |
| 3597 | + "engines": { | |
| 3598 | + "node": ">= 0.4" | |
| 3599 | + } | |
| 3600 | + }, | |
| 3352 | 3601 | "node_modules/uc.micro": { |
| 3353 | 3602 | "version": "2.1.0", |
| 3354 | 3603 | "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", |
@@ -3374,11 +3623,24 @@
| 3374 | 3623 | "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", |
| 3375 | 3624 | "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", |
| 3376 | 3625 | "dev": true, |
| 3626 | + "license": "MIT", | |
| 3377 | 3627 | "dependencies": { |
| 3378 | 3628 | "buffer": "^5.2.1", |
| 3379 | 3629 | "through": "^2.3.8" |
| 3380 | 3630 | } |
| 3381 | 3631 | }, |
| 3632 | + "node_modules/undici": { | |
| 3633 | + "version": "5.29.0", | |
| 3634 | + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", | |
| 3635 | + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", | |
| 3636 | + "license": "MIT", | |
| 3637 | + "dependencies": { | |
| 3638 | + "@fastify/busboy": "^2.0.0" | |
| 3639 | + }, | |
| 3640 | + "engines": { | |
| 3641 | + "node": ">=14.0" | |
| 3642 | + } | |
| 3643 | + }, | |
| 3382 | 3644 | "node_modules/uri-js": { |
| 3383 | 3645 | "version": "4.4.1", |
| 3384 | 3646 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", |
@@ -3393,13 +3655,15 @@
| 3393 | 3655 | "version": "1.0.2", |
| 3394 | 3656 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", |
| 3395 | 3657 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", |
| 3396 | − "dev": true | |
| 3658 | + "dev": true, | |
| 3659 | + "license": "MIT" | |
| 3397 | 3660 | }, |
| 3398 | 3661 | "node_modules/which": { |
| 3399 | 3662 | "version": "2.0.2", |
| 3400 | 3663 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", |
| 3401 | 3664 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", |
| 3402 | 3665 | "dev": true, |
| 3666 | + "license": "ISC", | |
| 3403 | 3667 | "dependencies": { |
| 3404 | 3668 | "isexe": "^2.0.0" |
| 3405 | 3669 | }, |
@@ -3410,17 +3674,51 @@
| 3410 | 3674 | "node": ">= 8" |
| 3411 | 3675 | } |
| 3412 | 3676 | }, |
| 3677 | + "node_modules/which-typed-array": { | |
| 3678 | + "version": "1.1.20", | |
| 3679 | + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", | |
| 3680 | + "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", | |
| 3681 | + "dev": true, | |
| 3682 | + "license": "MIT", | |
| 3683 | + "dependencies": { | |
| 3684 | + "available-typed-arrays": "^1.0.7", | |
| 3685 | + "call-bind": "^1.0.8", | |
| 3686 | + "call-bound": "^1.0.4", | |
| 3687 | + "for-each": "^0.3.5", | |
| 3688 | + "get-proto": "^1.0.1", | |
| 3689 | + "gopd": "^1.2.0", | |
| 3690 | + "has-tostringtag": "^1.0.2" | |
| 3691 | + }, | |
| 3692 | + "engines": { | |
| 3693 | + "node": ">= 0.4" | |
| 3694 | + }, | |
| 3695 | + "funding": { | |
| 3696 | + "url": "https://github.com/sponsors/ljharb" | |
| 3697 | + } | |
| 3698 | + }, | |
| 3699 | + "node_modules/word-wrap": { | |
| 3700 | + "version": "1.2.5", | |
| 3701 | + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", | |
| 3702 | + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", | |
| 3703 | + "dev": true, | |
| 3704 | + "license": "MIT", | |
| 3705 | + "engines": { | |
| 3706 | + "node": ">=0.10.0" | |
| 3707 | + } | |
| 3708 | + }, | |
| 3413 | 3709 | "node_modules/wrappy": { |
| 3414 | 3710 | "version": "1.0.2", |
| 3415 | 3711 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
| 3416 | 3712 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", |
| 3417 | − "dev": true | |
| 3713 | + "dev": true, | |
| 3714 | + "license": "ISC" | |
| 3418 | 3715 | }, |
| 3419 | 3716 | "node_modules/xtend": { |
| 3420 | 3717 | "version": "4.0.2", |
| 3421 | 3718 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", |
| 3422 | 3719 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", |
| 3423 | 3720 | "dev": true, |
| 3721 | + "license": "MIT", | |
| 3424 | 3722 | "engines": { |
| 3425 | 3723 | "node": ">=0.4" |
| 3426 | 3724 | } |
@@ -3436,9 +3734,9 @@
| 3436 | 3734 | } |
| 3437 | 3735 | }, |
| 3438 | 3736 | "node_modules/yaml": { |
| 3439 | − "version": "2.8.0", | |
| 3440 | − "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", | |
| 3441 | − "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", | |
| 3737 | + "version": "2.8.2", | |
| 3738 | + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", | |
| 3739 | + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", | |
| 3442 | 3740 | "dev": true, |
| 3443 | 3741 | "license": "ISC", |
| 3444 | 3742 | "bin": { |
@@ -3446,12 +3744,15 @@
| 3446 | 3744 | }, |
| 3447 | 3745 | "engines": { |
| 3448 | 3746 | "node": ">= 14.6" |
| 3747 | + }, | |
| 3748 | + "funding": { | |
| 3749 | + "url": "https://github.com/sponsors/eemeli" | |
| 3449 | 3750 | } |
| 3450 | 3751 | }, |
| 3451 | 3752 | "node_modules/yaml-eslint-parser": { |
| 3452 | − "version": "1.3.0", | |
| 3453 | − "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.3.0.tgz", | |
| 3454 | − "integrity": "sha512-E/+VitOorXSLiAqtTd7Yqax0/pAS3xaYMP+AUUJGOK1OZG3rhcj9fcJOM5HJ2VrP1FrStVCWr1muTfQCdj4tAA==", | |
| 3753 | + "version": "1.3.2", | |
| 3754 | + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.3.2.tgz", | |
| 3755 | + "integrity": "sha512-odxVsHAkZYYglR30aPYRY4nUGJnoJ2y1ww2HDvZALo0BDETv9kWbi16J52eHs+PWRNmF4ub6nZqfVOeesOvntg==", | |
| 3455 | 3756 | "dev": true, |
| 3456 | 3757 | "license": "MIT", |
| 3457 | 3758 | "dependencies": { |
@@ -3465,6 +3766,19 @@
| 3465 | 3766 | "url": "https://github.com/sponsors/ota-meshi" |
| 3466 | 3767 | } |
| 3467 | 3768 | }, |
| 3769 | + "node_modules/yaml-eslint-parser/node_modules/eslint-visitor-keys": { | |
| 3770 | + "version": "3.4.3", | |
| 3771 | + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", | |
| 3772 | + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", | |
| 3773 | + "dev": true, | |
| 3774 | + "license": "Apache-2.0", | |
| 3775 | + "engines": { | |
| 3776 | + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" | |
| 3777 | + }, | |
| 3778 | + "funding": { | |
| 3779 | + "url": "https://opencollective.com/eslint" | |
| 3780 | + } | |
| 3781 | + }, | |
| 3468 | 3782 | "node_modules/yarn": { |
| 3469 | 3783 | "version": "1.22.22", |
| 3470 | 3784 | "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz", |
@@ -3481,13 +3795,17 @@
| 3481 | 3795 | } |
| 3482 | 3796 | }, |
| 3483 | 3797 | "node_modules/yauzl": { |
| 3484 | − "version": "2.10.0", | |
| 3485 | − "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", | |
| 3486 | − "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", | |
| 3798 | + "version": "3.2.0", | |
| 3799 | + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.2.0.tgz", | |
| 3800 | + "integrity": "sha512-Ow9nuGZE+qp1u4JIPvg+uCiUr7xGQWdff7JQSk5VGYTAZMDe2q8lxJ10ygv10qmSj031Ty/6FNJpLO4o1Sgc+w==", | |
| 3487 | 3801 | "dev": true, |
| 3802 | + "license": "MIT", | |
| 3488 | 3803 | "dependencies": { |
| 3489 | 3804 | "buffer-crc32": "~0.2.3", |
| 3490 | − "fd-slicer": "~1.1.0" | |
| 3805 | + "pend": "~1.2.0" | |
| 3806 | + }, | |
| 3807 | + "engines": { | |
| 3808 | + "node": ">=12" | |
| 3491 | 3809 | } |
| 3492 | 3810 | }, |
| 3493 | 3811 | "node_modules/yocto-queue": { |
@@ -3495,6 +3813,7 @@
| 3495 | 3813 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", |
| 3496 | 3814 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", |
| 3497 | 3815 | "dev": true, |
| 3816 | + "license": "MIT", | |
| 3498 | 3817 | "engines": { |
| 3499 | 3818 | "node": ">=10" |
| 3500 | 3819 | }, |
modified
package.json
+2
−2
@@ -24,9 +24,9 @@
| 24 | 24 | "semver": "7.7.2" |
| 25 | 25 | }, |
| 26 | 26 | "devDependencies": { |
| 27 | − "@eslint/js": "9.38.0", | |
| 27 | + "@eslint/js": "10.0.1", | |
| 28 | 28 | "@vercel/ncc": "0.38.4", |
| 29 | − "eslint": "9.38.0", | |
| 29 | + "eslint": "10.0.1", | |
| 30 | 30 | "eslint-plugin-yml": "1.18.0", |
| 31 | 31 | "globals": "17.3.0", |
| 32 | 32 | "markdownlint-cli": "0.47.0", |
modified
src/setup-beam.js
+1
−1
@@ -576,7 +576,7 @@ function getVersionFromSpec(spec0, versions0) {
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | function maybeCoerced(v) { |
| 579 | − let ret = null | |
| 579 | + let ret | |
| 580 | 580 | try { |
| 581 | 581 | if (!isRC(v)) { |
| 582 | 582 | ret = semver.coerce(v).version |
Parents: e7fda7a